Skip to content

Commit f0bdc7c

Browse files
committed
bundler/inline: re-exec script after installation
Alternate: #7930 Fix: #7930 When bundler inline has to install gems, it loads more dependencies than when it goes through the fast path of all gems being installed. One of them is `securerandom` so if trying to use `bundler/inline` with a gem that have a dependency on `securerandom` that don't match the default version, the script fails with `Gem::LoadError`. This can be preproduced on Ruby 3.2.x, after making sure to `gem uninstall securerandom` so only the default gem remains`, and then running the following script: ```ruby require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'activesupport', '7.2.0' # depends on securerandom >= 0.3 end require 'securerandom' ```
1 parent b229140 commit f0bdc7c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bundler/lib/bundler/inline.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ def definition.lock(*); end
6060
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
6161
end
6262
end
63+
64+
unless install
65+
Bundler.ui.info "Re-executing program with installed gems"
66+
Process.exec(RbConfig.ruby, $PROGRAM_NAME, *ARGV)
67+
end
6368
end
6469

6570
runtime = Bundler::Runtime.new(nil, definition)

0 commit comments

Comments
 (0)