standalone/init: skip initial gem install in child processes

This commit is contained in:
Bo Anderson 2023-10-27 14:02:33 +01:00
parent ce63b7c7f0
commit c45572ecee
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -29,7 +29,10 @@ require_relative "../utils/gems"
Homebrew.setup_gem_environment!(setup_path: false)
# Install gems for Rubies we don't vendor for.
Homebrew.install_bundler_gems! if unsupported_ruby
if unsupported_ruby && !ENV["HOMEBREW_SKIP_INITIAL_GEM_INSTALL"]
Homebrew.install_bundler_gems!
ENV["HOMEBREW_SKIP_INITIAL_GEM_INSTALL"] = "1"
end
$LOAD_PATH.push HOMEBREW_LIBRARY_PATH.to_s unless $LOAD_PATH.include?(HOMEBREW_LIBRARY_PATH.to_s)
require_relative "../vendor/bundle/bundler/setup"