Skip to content

Commit

Permalink
fix: Fix for uri version mismatch error in certain bundler integratio…
Browse files Browse the repository at this point in the history
…n cases (#253)
  • Loading branch information
dazuma authored Jan 31, 2024
1 parent 031db8a commit 49c2334
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions toys-core/lib/toys/utils/gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ def find_lockfile_path(gemfile_path)
end

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

0 comments on commit 49c2334

Please sign in to comment.