[Bug #21723] Let force_activate() succeed when Gemfile contains path:#15373
Merged
hsbt merged 4 commits intoruby:masterfrom Jan 15, 2026
Merged
[Bug #21723] Let force_activate() succeed when Gemfile contains path:#15373hsbt merged 4 commits intoruby:masterfrom
path:#15373hsbt merged 4 commits intoruby:masterfrom
Conversation
…vate()
This patch fixes a problem where `binding.irb` (= force_activate('irb'))
fails under `bundle exec` when the Gemfile does not contain `irb` and
does contain a gem which is (1) not installed in GEM_HOME (2) sourced
using `path:`/`git:`.
The original approach constructing a temporary definition fails since
it does not set the equalivent of `path:`/`git:`.
Always reconstructing a definition from a Gemfile and applying lockfile
constraints should be a more robust approach.
[Bug #21723]
Member
|
Is this working with I confirmed that with this change and https://github.com/ruby/ruby/blob/master/spec/bundled_gems_spec.rb#L366. You can run that with |
Contributor
Author
|
Nice catch -- this indeed doesn't work. But that isn't this patch's fault, the same error reproduces on master. |
Contributor
Author
|
Member
|
I didn't say about |
Bundler::Runtime#setup requires a real existing lockfile (see Bundler::SharedHelpers#default_lockfile).
Contributor
Author
|
Understood. We have two problems:
7c1fc06 shall fix both. |
Contributor
Author
|
@hsbt Can you re-run the tests and check this again? I believe the failing tests are unrelated to this patch. |
Member
|
Done. |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch fixes a problem where
binding.irb(= force_activate('irb')) fails underbundle execwhen the Gemfile does not containirband does contain a gem which is (1) not installed in GEM_HOME (2) sourced usingpath:/git:.The original approach constructing a temporary definition fails since it does not set the equalivent of
path:/git:.Always reconstructing a definition from a Gemfile and applying lockfile constraints should be a more robust approach.
[Bug #21723]