cleanup: fix portable Ruby behaviour.

Better match the macOS behaviour in `ruby.sh`.

Fixes #9469
This commit is contained in:
Mike McQuaid 2020-12-09 11:50:45 +00:00
parent 123761054e
commit adab0fbb41
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
2 changed files with 3 additions and 0 deletions

View File

@ -455,6 +455,7 @@ export HOMEBREW_MACOS_VERSION_NUMERIC
export HOMEBREW_USER_AGENT export HOMEBREW_USER_AGENT
export HOMEBREW_USER_AGENT_CURL export HOMEBREW_USER_AGENT_CURL
export HOMEBREW_BOTTLE_DEFAULT_DOMAIN export HOMEBREW_BOTTLE_DEFAULT_DOMAIN
export HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH
if [[ -n "$HOMEBREW_MACOS" && -x "/usr/bin/xcode-select" ]] if [[ -n "$HOMEBREW_MACOS" && -x "/usr/bin/xcode-select" ]]
then then

View File

@ -361,6 +361,8 @@ module Homebrew
use_system_ruby = if Homebrew::EnvConfig.force_vendor_ruby? use_system_ruby = if Homebrew::EnvConfig.force_vendor_ruby?
false false
elsif OS.mac?
ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"].present?
else else
check_ruby_version = HOMEBREW_LIBRARY_PATH/"utils/ruby_check_version_script.rb" check_ruby_version = HOMEBREW_LIBRARY_PATH/"utils/ruby_check_version_script.rb"
rubies.uniq.any? do |ruby| rubies.uniq.any? do |ruby|