在升級 ruby的時候,使用了如下命令
curl -L https://get.rvm.io | bash -s stable --ruby
結果提示 : you need to make "brew update" avalabile.
我試了一下,果然 “brew update” 卡着不動。執行以下命令切換 brew 源。
第一步,替換brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
第二步:替換homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
此時執行“brew update” ok 了。