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
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:
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
crackgem:It shows information about
crack.Now add
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 envand paste the output belowEnvironment
Bundler Build Metadata
Bundler settings
Gemfile
Gemfile
Gemfile.lock