美文网首页
Homebrew 安装失败

Homebrew 安装失败

作者: 什锦甜 | 来源:发表于2018-07-13 22:01 被阅读55次

    之前在香港安装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
    
    /etc/hosts

    这时就可以ping 通github了

    再执行之前的安装命令

    ruby -e "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/master/install](https://raw.githubusercontent.com/Homebrew/install/master/install))"
    

    安装成功!


    安装成功

    相关文章

      网友评论

          本文标题:Homebrew 安装失败

          本文链接:https://www.haomeiwen.com/subject/udospftx.html