From 342f8e1e71d83d6a8a0e225964b90041f4367dc6 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 5 Nov 2021 12:35:46 +0000 Subject: [PATCH] vendor-install: better handle /usr/local arm64 ruby. Fixes https://github.com/Homebrew/brew/issues/12351 --- Library/Homebrew/cmd/vendor-install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 7a13aea315..10ca3630f0 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -14,7 +14,11 @@ VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor" # Built from https://github.com/Homebrew/homebrew-portable-ruby. if [[ -n "${HOMEBREW_MACOS}" ]] then - if [[ "${HOMEBREW_PROCESSOR}" == "Intel" ]] + if [[ "${HOMEBREW_PROCESSOR}" == "Intel" ]] || + # Handle the case where /usr/local/bin/brew is run under arm64. + # It's a x86_64 installation there (we refuse to install arm64 binaries) so + # use a x86_64 Portable Ruby. + [[ "${HOMEBREW_PROCESSOR}" == "arm64" && "${HOMEBREW_PREFIX}" == "/usr/local" ]] then ruby_FILENAME="portable-ruby-2.6.8.yosemite.bottle.tar.gz" ruby_SHA="0cb1cc7af109437fe0e020c9f3b7b95c3c709b140bde9f991ad2c1433496dd42"