Homebrew更新慢替换源(我用的是zsh,所以先用这个说明了,bash也一样,大差不差)
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"' >> ~/.zshrc
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"' >> ~/.zshrc
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"' >> ~/.zshrc
source ~/.zshrc
brew update
注:更新的时候查看执行过程可执行 brew update --verbose
今天分享的原因是因为准备在本地搭建一下环境,因为之前一直用的是docker,但是奈何mac内存有点小了顶不住,好了不说废话了,根本原因是因为在更新brew的时候出现了以下错误提示
brew Failed to install Homebrew Portable Ruby (and your system version is too old
这个是版本旧的原因,在本地删除了对应的老版本,然后再执行brew update
就没问题了