之前在香港安装homebrew一步就成功了,不知道这次安装为什么这么艰难。
安装官网方法在terminal执行如下:
ruby -e "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/master/install](https://raw.githubusercontent.com/Homebrew/install/master/install))"
出现以下错误
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': SSLRead() return error -9806
在网上看了很多方法,说需要梯子。但是我开了vpn还是不行。
尝试ping github.com
, 发现超时ping不通。
解决方案,打开/etc/hosts
(需要root权限)
vi /etc/hosts
添加如下解析
192.30.253.112 github.com git
151.101.185.194 github.global.ssl.fastly.net

这时就可以ping 通github了
再执行之前的安装命令
ruby -e "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/master/install](https://raw.githubusercontent.com/Homebrew/install/master/install))"
安装成功!

网友评论