Skip to content

Conversation

@deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Jul 17, 2025

What was the end-user or developer problem that led to this PR?

Introducing Gem.activate_and_load_bin_path in RubyGems 3.7.0 caused an issue when using RVM and versions of Bundler older that 2.5.23, where nested bundle exec invocations will fail.

Versions of Bundler not including f530f86 (Bundler < 2.5.23) needed to override Gem.activate_bin_path in order to support nested bundle exec invocations. However, since RubyGems 3.7.0 now uses a new Gem.load_and_activate_bin_path helper, those workarounds no longer work.

What is your fix for the problem, implemented in this PR?

Include the same workaround in RubyGems itself, when the version of Bundler being activated suffers from the problem.

Closes #8845.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/rvm-regression branch 6 times, most recently from ba63e48 to b016aa0 Compare July 17, 2025 16:21
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review July 17, 2025 16:22
Old versions of BUndler need a workaround to support nested `bundle
exec` invocations by overriding `Gem.activate_bin_path`. However,
RubyGems now uses this new `Gem.activate_and_load_bin_path` helper in
binstubs, which is of course not overridden in those Bundler versions
since it didn't exist at the time.

So, include the override here to workaround that.
@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/rvm-regression branch from b016aa0 to e5ed95e Compare July 18, 2025 06:19
@deivid-rodriguez deivid-rodriguez merged commit 6bafe4a into master Jul 21, 2025
73 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/rvm-regression branch July 21, 2025 09:06
deivid-rodriguez added a commit that referenced this pull request Jul 21, 2025
Fix regression in presence of RVM gems

(cherry picked from commit 6bafe4a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rubygems 3.7.0 + bundler 2.5.x causes LoadError due to invalid executable path (works with bundler 2.7.0)

2 participants