根据Homebrew网站,要安装它,我需要输入:
brew install wget
我得到一个错误消息:
-bash: brew: command not found
找到了这个答案。然而,问题是我在/usr/local/bin中没有看到brew。
我在.bashrc文件中添加了下面这行代码
export PATH=/usr/local/bin:$PATH
仍然得到命令未找到错误。
如何在macOS上安装Homebrew ?
根据Homebrew网站,要安装它,我需要输入:
brew install wget
我得到一个错误消息:
-bash: brew: command not found
找到了这个答案。然而,问题是我在/usr/local/bin中没有看到brew。
我在.bashrc文件中添加了下面这行代码
export PATH=/usr/local/bin:$PATH
仍然得到命令未找到错误。
如何在macOS上安装Homebrew ?
当前回答
在macOS上安装自制程序
要安装自制程序,你可以简单地在终端上运行这个命令…
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
如果你需要帮助安装任何包从自制这个页面应该有帮助
其他回答
在macOS上安装自制程序
要安装自制程序,你可以简单地在终端上运行这个命令…
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
如果你需要帮助安装任何包从自制这个页面应该有帮助
您可以使用以下命令安装brew。
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
然而,当使用这个你会得到警告,它购买自制安装程序现在已弃用。建议改用Bash。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
检查是否安装了Xcode:
$ gcc --version
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
$ brew doctor
$ brew update
http://techsharehub.blogspot.com/2013/08/brew-command-not-found.html“点击这里获取准确的指令更新”
在一个开箱即用的MacOS High Sierra 10.13.6
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
给出以下错误:
curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option. HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.
解决方案:只要在你的卷曲选项中添加一个k
$ ruby -e "$(curl -fsSLk https://raw.githubusercontent.com/Homebrew/install/master/install)"
对我有用的是设置BREW_FILE_DIRECTORY,如下所示
echo "export BREW_FILE_DIRECTORY=/opt" >> ~/.zshrc .
因为brew.sh文件在/opt/homebrew/bin下 在脚本中,所有内容似乎都是从BREW_FILE_DIRECTORY变量计算出来的。这在MacBook Pro (M1)上是可行的