mac安装brew命令

记录一下在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就搞定了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值