ruby / ruby/rubygems

Standalone bundle's setup.rb should implement Gem.try_activate to avoid breaking binding.irb

Open
#7,545 4 comments 1 reaction 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

I set --disable-gems in my RUBYOPT variable.

binding.irb causes a call to Gem.try_activate whenever the Gem constant is defined.

Standalone bundles include a bundler/setup.rb file, which defines the Gem constant even when Rubygems isn't required.

Thus, for me, binding.irb doesn't work with standalone bundles.

Did you try upgrading rubygems & bundler?

No, because I can see that Bundler's implementation is still incorrect: https://github.com/rubygems/rubygems/blob/master/bundler/lib/bundler/installer/standalone.rb#L79-L97

Post steps to reproduce the problem
  • export RUBYOPT=--disable-gems
  • Install a standalone bundle
  • After requiring bundler/setup from the standalone bundle, add a binding.irb statement
  • Observe the undefined method error on Gem.try_activate
Which command did you run?

bundle install --standalone

What were you expecting to happen?

binding.irb to work

What actually happened?

binding.irb didn't work

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

Not sure how to do this

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 in bundler/lib/bundler/installer/standalone.rb at the linked implementation and inspect how the standalone bundle's setup.rb defines Gem. Reproduce with RUBYOPT=--disable-gems, bundle install --standalone, and binding.irb; done means binding.irb works after requiring the standalone setup file without an undefined Gem.try_activate error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.