install: add workaround for rosetta2 path error msg
It's possible the user's terminal emulator is running under rosetta2. Consequently, the i86_64 version of the ruby interpreter will be used. Likely, the right thing to do is simply install the arm64 version of the requested package. This can be accomplished using: arch -arm64 brew ... Fixes: #10313
This commit is contained in:
parent
663b972f44
commit
9b4fea602b
@ -32,12 +32,16 @@ module Homebrew
|
|||||||
def check_prefix
|
def check_prefix
|
||||||
if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) &&
|
if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) &&
|
||||||
HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
|
HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
|
||||||
configuration = if Hardware::CPU.in_rosetta2?
|
if Hardware::CPU.in_rosetta2?
|
||||||
"under Rosetta 2"
|
configuration = "under Rosetta 2"
|
||||||
|
odie <<~EOS
|
||||||
|
Cannot install in Homebrew #{configuration} in ARM default prefix (#{HOMEBREW_PREFIX})!
|
||||||
|
Try `arch -arm64 brew install ...`
|
||||||
|
EOS
|
||||||
else
|
else
|
||||||
"on Intel processor"
|
configuration = "on Intel processor"
|
||||||
|
odie "Cannot install in Homebrew #{configuration} in ARM default prefix (#{HOMEBREW_PREFIX})!"
|
||||||
end
|
end
|
||||||
odie "Cannot install in Homebrew #{configuration} in ARM default prefix (#{HOMEBREW_PREFIX})!"
|
|
||||||
elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX
|
elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX
|
||||||
odie <<~EOS
|
odie <<~EOS
|
||||||
Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})!
|
Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user