官方網(wǎng)址 : https://brew.sh
官方提供安裝方法 (但是常常會有報錯)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
1、報告錯誤
fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:50517
Failed during: git fetch origin master:refs/remotes/origin/master --tags —force
解決辦法:
1. ping [http://github.com](https://link.zhihu.com/?target=http%3A//github.com) 獲取ip地址
2. Command+Shift+G,打開/etc/hosts文件,將域名添加上就可以了:192.30.253.113 [http://github.com](https://link.zhihu.com/?target=http%3A//github.com) (**hosts文件修改后,會提示沒有權(quán)限,分享一個我的做法:將hosts文件復制一個到桌面,添加完域名,保存,再將此文件拖回到etc文件夾下,替換掉原來的文件,中間根據(jù)提示輸入用戶密碼即可**)
(推薦使用)
sudo vim /etc/hosts
然后輸入你電腦的密碼進入host文件,
按 i 鍵進入編輯狀態(tài),修改host。
然后,ESC退出編輯狀態(tài),輸入 :wq 保存并退出vim
2、報告錯誤
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
解決辦法: 使用國內(nèi)資源
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"