2021.3.14更新
- 已经有大佬做出国内的安装脚本
- 运行如下命令即可
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
安装Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.fastgit.org/Homebrew/install/master/install)"
解决「Failed to install vendor Ruby」问题
国内特殊环境,安装Homebrew会出现这个问题。 解决办法如下。
- 更换国内源. 以下是更换「清华大学源」
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/linuxbrew-core.git
brew update
测试
输入 brew help
测试能否正常执行
说明
安装Homebrew过程中可能需要输入密码,出现钥匙状图标时自行输入。在输入密码时不可见,但实际已输入。