/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
开始一直报错Failed to connect to raw.githubusercontent.com port 443: Connection refused error: Error: 7,
尝试过改动git config的代理,没有用,
换中科大的源,也没有用
最后解决办法如下,重装command line tools,再执行安装指令,homebrew安装成功。
removing the old tools ($ rm -rf /Library/Developer/CommandLineTools)
install xcode command line tools again ($ xcode-select --install).
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
方法二
问题:macOS安装Homebrew时总是报错(Failed to connect to raw.githubusercontent.com port 443: Connection refused)
原因:由于某些你懂的因素
,导致GitHub的raw.githubusercontent.com
域名解析被污染了。
解决办法:通过修改hosts
解决此问题。
查询真实IP
在https://www.ipaddress.com/查询raw.githubusercontent.com的真实IP。
修改hosts
sudo vim /etc/hosts
添加如下内容:
199.232.28.133 raw.githubusercontent.com
如图:
网上都说是网不通,可是我也挂着 ss,应该不是这个问题,很多解决方法是修改成镜像的链接,不过貌似都不见效。试着在终端 ping 了一下 GitHub 的地址:
ping github.com
- 1
结果出现了下面这个结果,还真是网不通。
解决方案
修改 host 配置,在终端中输入下列指令,打开编辑文件。
sudo vi /etc/hosts
- 1
按 s键 进入编辑模式,在最下面添加 13.229.188.59 github.com
再次尝试在终端 ping github.com,发现已经成功了。
常见问题
在安装过程中,出现如下错误,也是网不通
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
- 1
- 2
有时候如果不做如上操作,偶尔重试会出现成功的概率