安裝
進(jìn)入官網(wǎng)復(fù)制命令
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
錯(cuò)誤
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
解決
- 打開
https://raw.githubusercontent.com/Homebrew/install/master/install
網(wǎng)頁(yè)內(nèi)存保存為brew_install.rb
2.鏈接: https://pan.baidu.com/s/1bxdQ1NMkS20IICiuOdBUlA 提取碼: 517q
3.執(zhí)行命令
ruby brew_install.rb(文件路徑)
如遇錯(cuò)誤
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
執(zhí)行安裝命令
如遇錯(cuò)誤
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
執(zhí)行命令
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
如遇錯(cuò)誤
==> 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路徑中的文件 因?yàn)橄螺d未完成中斷的原因
更改鏡像地址
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
網(wǎng)盤不能用時(shí)請(qǐng)聯(lián)系249086205@qq.com