Merge pull request #9465 from MikeMcQuaid/ruby-version
Fix macOS Ruby version handling
This commit is contained in:
commit
ddfd499c20
@ -1,17 +0,0 @@
|
||||
# typed: false
|
||||
# frozen_string_literal: true
|
||||
|
||||
macos_version = ENV["HOMEBREW_MACOS_VERSION"][0..4]
|
||||
macos_sdk = "MacOSX#{macos_version}.sdk"
|
||||
|
||||
# Ruby hardcodes what might end up being an incorrect SDK path in some of the
|
||||
# variables that get used in mkmf.rb.
|
||||
# This patches them up to use the correct SDK.
|
||||
RbConfig::CONFIG.each do |k, v|
|
||||
next unless v.include?("MacOSX.sdk")
|
||||
|
||||
new_value = v.gsub("MacOSX.sdk", macos_sdk)
|
||||
next unless File.exist?(new_value)
|
||||
|
||||
RbConfig::CONFIG[k] = new_value
|
||||
end
|
||||
@ -109,15 +109,6 @@ module Homebrew
|
||||
install_bundler!
|
||||
|
||||
ENV["BUNDLE_GEMFILE"] = File.join(ENV.fetch("HOMEBREW_LIBRARY"), "Homebrew", "Gemfile")
|
||||
|
||||
# We can't use OS.mac? because not enough has
|
||||
# been required yet this early in the boot process
|
||||
if ENV["HOMEBREW_SYSTEM"] == "Macintosh"
|
||||
# This patches up some paths used by mkmf.rb
|
||||
extend_path = File.join(ENV.fetch("HOMEBREW_LIBRARY"), "Homebrew", "extend")
|
||||
ENV["RUBYOPT"] = "-r#{extend_path}/rbconfig_extension"
|
||||
end
|
||||
|
||||
@bundle_installed ||= begin
|
||||
bundle = File.join(find_in_path("bundle"), "bundle")
|
||||
bundle_check_output = `#{bundle} check 2>&1`
|
||||
@ -135,8 +126,6 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
ENV["RUBYOPT"] = ""
|
||||
|
||||
setup_gem_environment!
|
||||
end
|
||||
end
|
||||
|
||||
@ -32,7 +32,8 @@ unusable_ruby() {
|
||||
if [[ -n "$HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH" ]]
|
||||
then
|
||||
return 1
|
||||
elif [[ -n "$HOMEBREW_RUBY_PATH" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]] && test_ruby "$HOMEBREW_RUBY_PATH"
|
||||
elif [[ -z "$HOMEBREW_MACOS" && -n "$HOMEBREW_RUBY_PATH" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]] &&
|
||||
test_ruby "$HOMEBREW_RUBY_PATH"
|
||||
then
|
||||
return 1
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user