Skip to content

"bundle list" can not find an installed gem after running "bundle install --standalone" #9185

@junaruga

Description

@junaruga

Describe the problem as clearly as you can

I am using the ruby at the ruby/ruby master branch relatively latest commit ed18a212abe2d92feb441db2b6f084c0c77a65e4, and the bundle command in it.

After running, bundle install, gem uninstall gem2rpm, bundle install --standalone, then bundle list fails.

Did you try upgrading rubygems & bundler?

I tried to run the gem update --system. However, the gem update --system was stucking. So, I couldn't run the command.

Post steps to reproduce the problem

OS: Fedora Linux 42
Ruby: ruby/ruby master branch commit compiled from the source.

$ which ruby
~/.local/ruby-4.0.0dev-debug-ed18a212ab/bin/ruby
$ ruby -v
ruby 4.0.0dev (2025-12-10T16:08:55Z master ed18a212ab) +PRISM [x86_64-linux]
$ which gem
~/.local/ruby-4.0.0dev-debug-ed18a212ab/bin/gem
$ gem -v
4.0.1
$ which bundle
~/.local/ruby-4.0.0dev-debug-ed18a212ab/bin/bundle
$ bundle -v
4.0.1
$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 4.0.1
  - RUBY VERSION: 4.0.0 (2025-12-11 patchlevel -1) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/lib/ruby/gems/4.0.0+0
  - USER INSTALLATION DIRECTORY: /home/jaruga/.local/share/gem/ruby/4.0.0+0
  - CREDENTIALS FILE: /home/jaruga/.local/share/gem/credentials
  - RUBY EXECUTABLE: /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/bin/ruby
  - GIT EXECUTABLE: /bin/git
  - EXECUTABLE DIRECTORY: /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/bin
  - SPEC CACHE DIRECTORY: /home/jaruga/.cache/gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-linux
  - GEM PATHS:
     - /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/lib/ruby/gems/4.0.0+0
     - /home/jaruga/.local/share/gem/ruby/4.0.0+0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/bin
     - /usr/local/wasmtime-1.0.1/bin
     - /home/jaruga/.go/bin
     - /home/jaruga/git/gem2rpm/bin
     - /home/jaruga/git/rpmlint/dist/usr/bin
     - /bin
     - /usr/bin
     - /usr/sbin
     - /usr/local/bin
     - /usr/local/sbin
     - /home/jaruga/bin
     - /home/jaruga/.local/bin
     - /home/jaruga/.local/FASTK-f18a4e6/bin
     - /home/jaruga/.local/GENESCOPE.FK-380815c/bin
     - /home/jaruga/.local/MERQURY.FK-8f3ab70/bin
     - /var/lib/snapd/snap/bin
     - /usr/local/powercap/bin
     - /usr/local/mongodb-linux-x86_64-rhel80-4.4.1/bin
     - /home/jaruga/.npm-global/bin

Steps:

$ cat Gemfile
source 'https://rubygems.org'

gem 'gem2rpm'
$ bundle install
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching gem2rpm 1.0.2
Installing gem2rpm 1.0.2
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

$ bundle list
Gems included by the bundle:
  * gem2rpm (1.0.2)
Use `bundle info` to print more detailed information about a gem

$ gem uninstall gem2rpm
Remove executables:
	gem2rpm

in addition to the gem? [Yn]  Y
Removing gem2rpm
Successfully uninstalled gem2rpm-1.0.2

$ rm Gemfile.lock

$ bundle install --verbose --standalone
Running `bundle install --standalone  --verbose` with bundler 4.0.1
Resolving dependencies because there's no lockfile
HTTP GET https://index.rubygems.org/versions
HTTP 206 Partial Content https://index.rubygems.org/versions
Fetching gem metadata from https://rubygems.org/
Looking up gems ["gem2rpm"]
Resolving dependencies...
Using bundler 4.0.1
0:  bundler (4.0.1) from /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/lib/ruby/gems/4.0.0+0/specifications/default/bundler-4.0.1.gemspec
Fetching gem2rpm 1.0.2
Downloaded gem2rpm in: 0.119s
Installing gem2rpm 1.0.2
Installed gem2rpm in: 0.007s
1:  gem2rpm (1.0.2) from /home/jaruga/doc/memo/20251212_bundler_test/bundle/ruby/4.0.0+0/specifications/gem2rpm-1.0.2.gemspec
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into `./bundle`

$ bundle list
Could not find gem2rpm-1.0.2 in locally installed gems
Install missing gems with `bundle install`.

$ ls
bundle/  Gemfile  Gemfile.lock

$ ls bundle/ruby/4.0.0+0/gems/gem2rpm-1.0.2/
AUTHORS  bin/  lib/  LICENSE  README.md  templates/

But it seems the gem2rpm gem was installed in the bundle/ruby/4.0.0+0/gems/gem2rpm-1.0.2/ regardless the message Could not find gem2rpm-1.0.2 in locally installed gems.

Which command did you run?

bundle install, bundle list

What were you expecting to happen?

The bundle list shows a list of the gems without error.

What happened instead?

$ bundle list
Could not find gem2rpm-1.0.2 in locally installed gems
Install missing gems with `bundle install`.

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

$ bundle env

Environment

Bundler       4.0.1
  Platforms   ruby, x86_64-linux
Ruby          4.0.0p-1 (2025-12-11 revision ed18a212abe2d92feb441db2b6f084c0c77a65e4) [x86_64-linux]
  Full Path   /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/bin/ruby
  Config Dir  /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/etc
RubyGems      4.0.1
  Gem Home    /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/lib/ruby/gems/4.0.0+0
  Gem Path    /home/jaruga/.local/share/gem/ruby/4.0.0+0:/home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/lib/ruby/gems/4.0.0+0
  User Home   /home/jaruga
  User Path   /home/jaruga/.local/share/gem/ruby/4.0.0+0
  Bin Dir     /home/jaruga/.local/ruby-4.0.0dev-debug-ed18a212ab/bin
Tools
  Git         2.51.0
  RVM         not installed
  rbenv       not installed
  chruby      not installed

Bundler Build Metadata

Timestamp  2025-12-12
Git SHA    unknown

Gemfile

Gemfile

source 'https://rubygems.org'

gem 'gem2rpm'

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    gem2rpm (1.0.2)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  gem2rpm

CHECKSUMS
  gem2rpm (1.0.2) sha256=21695912765a469cdde0d2ace690b8485ae43ec195866c3a51eed3584975eafd

BUNDLED WITH
  4.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions