diff --git a/Library/Homebrew/dev-cmd/prof.rb b/Library/Homebrew/dev-cmd/prof.rb index 0d49f551a5..d5b100c165 100644 --- a/Library/Homebrew/dev-cmd/prof.rb +++ b/Library/Homebrew/dev-cmd/prof.rb @@ -32,7 +32,7 @@ module Homebrew if args.stackprof? Homebrew.install_gem_setup_path! "stackprof" with_env HOMEBREW_STACKPROF: "1" do - system ENV["HOMEBREW_RUBY_PATH"], brew_rb, *args.named + system RUBY_PATH, brew_rb, *args.named end output_filename = "prof/d3-flamegraph.html" safe_system "stackprof --d3-flamegraph prof/stackprof.dump > #{output_filename}" diff --git a/Library/Homebrew/dev-cmd/ruby.rb b/Library/Homebrew/dev-cmd/ruby.rb index 77395db575..ee0ddf6410 100644 --- a/Library/Homebrew/dev-cmd/ruby.rb +++ b/Library/Homebrew/dev-cmd/ruby.rb @@ -33,10 +33,9 @@ module Homebrew ruby_sys_args << "-e #{args.e}" if args.e ruby_sys_args += args.named - exec RUBY_PATH, - ENV["HOMEBREW_RUBY_WARNINGS"], + exec(*HOMEBREW_RUBY_EXEC_ARGS, "-I", $LOAD_PATH.join(File::PATH_SEPARATOR), "-rglobal", "-rdev-cmd/irb", - *ruby_sys_args + *ruby_sys_args) end end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 8ea009c007..d2357b2fa5 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -1084,12 +1084,12 @@ class FormulaInstaller sig { void } def post_install - args = %W[ - nice #{RUBY_PATH} - #{ENV["HOMEBREW_RUBY_WARNINGS"]} - -I #{$LOAD_PATH.join(File::PATH_SEPARATOR)} - -- - #{HOMEBREW_LIBRARY_PATH}/postinstall.rb + args = [ + "nice", + *HOMEBREW_RUBY_EXEC_ARGS, + "-I", $LOAD_PATH.join(File::PATH_SEPARATOR), + "--", + HOMEBREW_LIBRARY_PATH/"postinstall.rb" ] # Use the formula from the keg if: diff --git a/Library/Homebrew/startup/bootsnap.rb b/Library/Homebrew/startup/bootsnap.rb index f115b62875..a3ebe359c5 100644 --- a/Library/Homebrew/startup/bootsnap.rb +++ b/Library/Homebrew/startup/bootsnap.rb @@ -5,7 +5,7 @@ homebrew_bootsnap_enabled = !ENV["HOMEBREW_NO_BOOTSNAP"] && ENV["HOMEBREW_BOOTSN # portable ruby doesn't play nice with bootsnap # Can't use .exclude? here because we haven't required active_support yet. -homebrew_bootsnap_enabled &&= !ENV["HOMEBREW_RUBY_PATH"].to_s.include?("/vendor/portable-ruby/") # rubocop:disable Rails/NegateInclude +homebrew_bootsnap_enabled &&= !RUBY_PATH.to_s.include?("/vendor/portable-ruby/") # rubocop:disable Rails/NegateInclude homebrew_bootsnap_enabled &&= if ENV["HOMEBREW_MACOS_VERSION"] # Apple Silicon doesn't play nice with bootsnap