安裝 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
安裝出現以下錯誤:
正在連接 raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443… 失敗:拒絕連接。
正在連接 raw.githubusercontent.com (raw.githubusercontent.com)|:😐:443… 失敗:拒絕連接。
解決方案:
進入網站:https://site.ip138.com/raw.Githubusercontent.com/
輸入raw.githubusercontent.com
查詢其相關的IP地址:
在Mac終端輸入:
sudo vi /etc/hosts
選擇上面一個添加內容即可:
比如:
151.101.76.133 raw.githubusercontent.com
或者
151.101.228.133 raw.githubusercontent.com
然後保存,退出
再次安裝 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
安裝成功
安裝出現以下錯誤:
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
解決方案:
可以使用命令修復
git config --global http.postBuffer 524288000
注意:執行完這裏的命令之後需要關閉終端,然後重新執行安裝命令纔會有效。這裏是對Git對配置,個人覺的安裝最新版的git應該也可以解決,沒有嘗試
。
sudo vim .bash_profile
添加
export PATH=/usr/local/bin:$PATH
保存,
source .bash_profile
使配置修改生效。
重新啓動終端