收到蘋果官方的郵件去Apple實體店檢修了硬盤,結果系統重裝,東西都沒了。
上次回來之后開始安裝各種環境和軟件,結果,homebrew一直安裝不成功。今天在帥帥的指導下弄好了,下面記錄一下經過...
【前傾提要】
Mac系統:macOS Mojave -v 10.14.2
按照 homebrew官網 的方式安裝,提示的錯誤如下:
LXMAJSs-MacBook-Pro:issues lxmajs$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/brew/': transfer closed with outstanding read data remaining
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force
【解決辦法】
參考了官方github的issue,有人也遇到了相同的問題:
https://github.com/Homebrew/legacy-homebrew/issues/46717
解決辦法是:
1、自選一個homebrew的版本庫,將其代碼clone到本地,終端命令如下:
git clone https://github.com/Homebrew/homebrew.git /tmp/homebrew
2、clone到本地后,可嘗試運行homebrew查看版本的命令,命令如下:
brew -v
若提示版本號,則表示本地自動安裝成功,若未提示,在執行第三步
3、執行官方安裝腳本的命令:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
到此,再嘗試第二步查看homebrew的版本,見如下提示則表示成功安裝,問題解決: