Skip to content

Commit 49c2334

Browse files
authored
fix: Fix for uri version mismatch error in certain bundler integration cases (#253)
1 parent 031db8a commit 49c2334

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

toys-core/lib/toys/utils/gems.rb

+7
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,13 @@ def find_lockfile_path(gemfile_path)
304304
end
305305

306306
def setup_bundle(gemfile_path, groups: nil, retries: nil)
307+
# Ensure certain built-in gems that may be used by bundler/rubygems
308+
# themselves are preloaded so they can be included in the modified
309+
# gemfile. This prevents a gem version mismatch if bundler/rubygems
310+
# loads a version of the gem during the bundler setup code (i.e. after
311+
# the modified gemfile is created) but the gemfile lock itself calls
312+
# for a different version.
313+
require "uri"
307314
# Lock the bundler version, preventing bundler's SelfManager from
308315
# installing a different bundler and taking over the process.
309316
::ENV["BUNDLER_VERSION"] = ::Bundler::VERSION

0 commit comments

Comments
 (0)