From adab0fbb41676410229228e96d81f7d5319c719a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 9 Dec 2020 11:50:45 +0000 Subject: [PATCH] cleanup: fix portable Ruby behaviour. Better match the macOS behaviour in `ruby.sh`. Fixes #9469 --- Library/Homebrew/brew.sh | 1 + Library/Homebrew/cleanup.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index d448ca3337..871c08ab93 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -455,6 +455,7 @@ export HOMEBREW_MACOS_VERSION_NUMERIC export HOMEBREW_USER_AGENT export HOMEBREW_USER_AGENT_CURL export HOMEBREW_BOTTLE_DEFAULT_DOMAIN +export HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH if [[ -n "$HOMEBREW_MACOS" && -x "/usr/bin/xcode-select" ]] then diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 2a8f57c92d..93730daced 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -361,6 +361,8 @@ module Homebrew use_system_ruby = if Homebrew::EnvConfig.force_vendor_ruby? false + elsif OS.mac? + ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"].present? else check_ruby_version = HOMEBREW_LIBRARY_PATH/"utils/ruby_check_version_script.rb" rubies.uniq.any? do |ruby|