我使用的命令:arch -arm64 brew install v8@3.15
这是我得到的错误:
Error: v8@3.15: no bottle available!
You can try to install from source with:
brew install --build-from-source v8@3.15
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
最佳答案
这是因为您没有使用 arch -arm64
选项安装 brew。
如果您按照以下步骤进行操作,它应该会起作用:
$ arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
将此附加到您的 .bashrc 或 .zshrc 并获取它:
alias ibrew="arch -x86_64 brew"
export PATH="/usr/local/homebrew/bin:$PATH"
安装 libv8:
$ ibrew install v8@3.15
安装ruby(可能是常见的情况):
$ ibrew install rbenv
$ arch -x86_64 rbenv install <ruby_version>
$ arch -x86_64 rbenv global <ruby_version>
将此附加到您的 .bashrc 或 .zshrc 并获取它:
eval "$(rbenv init -)"
修复 libv8 问题:
$ gem install libv8 -v '<your version>' -- --with-system-v8
$ gem install therubyracer -v '<your version>' -- --with-v8-dir=$(ibrew --prefix v8@3.15)
关于macos - 我无法通过 Homebrew 软件在 Mac M1 上安装 v8@3.15,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68922404/