记录一下在mac上安装HomeBrew的坑。
使用brew官网的命令安装brew失败
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
然后我试了一下
curl -v https://raw.githubusercontent.com/Homebrew/install/master/install.sh
* Trying 0.0.0.0...
* TCP_NODELAY set
* Connection failed
* connect to 0.0.0.0 port 443 failed: Connection refused
* Failed to connect to raw.githubusercontent.com port 443: Connection refused
* Closing connection 0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
这都不行,那玩个锤子。
然后我就去刷知乎了:https://www.zhihu.com/question/35928898/answer/924797299
原来是因为目前 GitHub 的 gist 访问不了,所以获取不到安装的脚本文件。我把该脚本文件上传到了 gitee gist 托管平台,执行下面的脚本就可以安装了。
/usr/bin/ruby -e "$(curl -fsSL https://gitee.com/xueweihan/codes/vfrgh7z8qcjlx1ubwt6nk71/raw\?blob_name\=brew_install.sh)"
试了一下,果然可以。
然后:
==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force
这尼玛,这也太难了吧。
然后我一看我ping github.com竟然全是timeout。
吓得我都慌了。
然后又找到这篇blog
https://blog.csdn.net/u010377383/article/details/79365049
然后访问
http://github.global.ssl.fastly.net.ipaddress.com/查看ip。
然后sudo vim /etc/hosts.
修改hosts就搞定了。