Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existence of this gem causes LoadError on Bundler.require of unrelated project #54

Open
scivola opened this issue Dec 18, 2024 · 0 comments

Comments

@scivola
Copy link

scivola commented Dec 18, 2024

Describe the problem as clearly as you can

If rubygems-generate_index gem is installed, LoadError occurs when Bundler.require.

Did you try upgrading RubyGems?

% ruby -v
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [arm64-darwin24]
% gem -v
3.6.1
% bundle -v
Bundler version 2.6.1

Post steps to reproduce the problem

Here are minimal reproduction codes.

Gemfile:

source "https://rubygems.org"

sample.rb:

require "bundler/setup"
Bundler.require

Then:

% ruby sample.rb

It is no problem!

But we install rubygems-generate_index gem:

% gem install rubygems-generate_index 

And then:

% ruby sample.rb  
Error loading RubyGems plugin "/Users/XXXXX/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/plugins/rubygems-generate_index_plugin.rb": cannot load such file -- compact_index (LoadError)

Run gem env and paste the output below

RubyGems Environment:
  - RUBYGEMS VERSION: 3.6.1
  - RUBY VERSION: 3.3.6 (2024-11-05 patchlevel 108) [arm64-darwin24]
  - INSTALLATION DIRECTORY: /Users/XXXXX/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0
  - USER INSTALLATION DIRECTORY: /Users/XXXXX/.local/share/gem/ruby/3.3.0
  - RUBY EXECUTABLE: /Users/XXXXX/.rbenv/versions/3.3.6/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /Users/XXXXX/.rbenv/versions/3.3.6/bin
  - SPEC CACHE DIRECTORY: /Users/XXXXX/.cache/gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/XXXXX/.rbenv/versions/3.3.6/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-24
  - GEM PATHS:
     - /Users/XXXXX/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0
     - /Users/XXXXX/.local/share/gem/ruby/3.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
     - "install" => "--no-document"
     - "update" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/XXXXX/.rbenv/versions/3.3.6/bin
     - /opt/homebrew/Cellar/rbenv/1.3.0/libexec
     - /Users/XXXXX/.rbenv/shims
     - /Users/XXXXX/bin
     - /opt/homebrew/bin
     - /opt/homebrew/sbin
     - /usr/local/bin
     - /System/Cryptexes/App/usr/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
     - /Users/XXXXX/.rbenv/shims
     - /Users/XXXXX/bin
     - /Users/XXXXX/.cargo/bin

Note

If we change the line

require "bundler/setup"

to

require "bundler"

LoadError does not occur.

And if we uninstall rubygems-generate_index gem, LoadError does not occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant