安装
进入官网复制命令
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
错误
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
解决
- 打开
https://raw.githubusercontent.com/Homebrew/install/master/install
网页内存保存为brew_install.rb
2.链接: https://pan.baidu.com/s/1bxdQ1NMkS20IICiuOdBUlA 提取码: 517q
3.执行命令
ruby brew_install.rb(文件路径)
如遇错误
BREW_REPO = "https://github.com/Homebrew/brew".freeze
修改为
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
CORE_TAP_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git".freeze
执行安装命令
如遇错误
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
Failed during: /usr/local/bin/brew update --force
执行命令
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
如遇错误
==> Downloading and installing Homebrew...
HEAD is now at 0ff53e6c9 Merge pull request #6665 from Homebrew/dependabot/bundler/Library/Homebrew/tins-1.22.0
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Already downloaded: /Users/xinhuotech/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Error: Checksum mismatch.
Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104
Actual: 5480cd10ac7f9fe4b1a23ca72ae93e7dd3c4bfa87db79159482177e8420003c0
Archive: /Users/xinhuotech/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
Failed during: /usr/local/bin/brew update --force
移除Archive路径中的文件 因为下载未完成中断的原因
更改镜像地址
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
更新 检查
brew update
brew doctor
网盘不能用时请联系249086205@qq.com