Merge pull request #15532 from Bo98/bundler-version

utils/gems: fix bundler sometimes unnecessarily reinstalling
This commit is contained in:
Mike McQuaid 2023-06-07 13:36:56 +01:00 committed by GitHub
commit cada95f958
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,13 +134,19 @@ module Homebrew
end
def install_bundler!
old_bundler_version = ENV.fetch("BUNDLER_VERSION", nil)
setup_gem_environment!
ENV["BUNDLER_VERSION"] = HOMEBREW_BUNDLER_VERSION # Set so it correctly finds existing installs
install_gem_setup_path!(
"bundler",
version: HOMEBREW_BUNDLER_VERSION,
executable: "bundle",
setup_gem_environment: false,
)
ensure
ENV["BUNDLER_VERSION"] = old_bundler_version
end
def install_bundler_gems!(only_warn_on_failure: false, setup_path: true, groups: [])