ruby / ruby/rubygems

`bundle info` is not using exact match

Open
#9,441 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bundler
Dominant language
Ruby
Stars
4k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
81

Description

Describe the problem as clearly as you can

Running bundle info [GEMNAME] uses what appears to be a substring match instead of an exact match. This makes it hard to use in certain scenarios, current use case: Look for all systems running an outdated version of rack by executing "bundle info rack" on those systems.

The documentation says:

Show information for the given gem in your bundle

Which would vaguely suggest that it should be using exact match. In addition it only shows information about one gem, so even if multiple gems match the substring it will pick one, which furthers the argument that it should only use exact match to have consistency.

If it's not possible to change the current behaviour a flag to use exact matching would be helpful.

Did you try upgrading rubygems & bundler?

I'm on Bundler 4.0.9.

Post steps to reproduce the problem

Make a new project, add the crack gem:

bundle add crack
bundle info rack

It shows information about crack.

Now add rack:

bundle add rack
bundle info rack

It now shows information about rack.

What were you expecting to happen?

It should only show information about the gem with an exact match and not show information about other gems with names that resemble the query.

If not included with the output of your command, run bundle env and paste the output below

Environment

Bundler       4.0.9
  Platforms   ruby, arm64-darwin-25
Ruby          4.0.2p0 (2026-03-17 revision d3da9fec828481422cc4084892454bf572d7af5a) [arm64-darwin-25]
  Full Path   .../ruby/4.0.2/bin/ruby
  Config Dir  .../ruby/4.0.2/etc
RubyGems      4.0.6
  Gem Home    .../ruby/4.0.2/lib/ruby/gems/4.0.0
  Gem Path    .../ruby/4.0.2/lib/ruby/gems/4.0.0
  User Home   ...
  User Path   ...
  Bin Dir     ...
Tools         
  Git         2.53.0
  RVM         not installed
  rbenv       not installed
  chruby      

Bundler Build Metadata

Timestamp  2026-04-01
Git SHA    3ce4a32411

Bundler settings

Gemfile

Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

# gem "rails"

gem "crack", "~> 1.0"

gem "rack", "~> 3.2"
Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    bigdecimal (4.1.0)
    crack (1.0.1)
      bigdecimal
      rexml
    rack (3.2.6)
    rexml (3.4.4)

PLATFORMS
  arm64-darwin-25
  ruby

DEPENDENCIES
  crack (~> 1.0)
  rack (~> 3.2)

CHECKSUMS
  bigdecimal (4.1.0) sha256=6dc07767aa3dc456ccd48e7ae70a07b474e9afd7c5bc576f80bd6da5c8dd6cae
  crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
  rack (3.2.6) sha256=5ed78e1f73b2e25679bec7d45ee2d4483cc4146eb1be0264fc4d94cb5ef212c2
  rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142

BUNDLED WITH
  4.0.9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported behavior with bundle add crack followed by bundle info rack, then repeat after adding rack. Trace the bundle info command's gem selection and verify that the result is limited to an exact name match, with the documented behavior and reproduction covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.