fatal: unable to access 'https://github.com/Homebrew/brew/'

最近安装 Homebrew 遇到的坑,总结一下。
我的 Mac 版本是 10.13.6。

  1. 首先安装 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  • 报错信息:
fatal: unable to access 'https://github.com/Homebrew/brew/': Could not resolve host: github.com
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force
  1. 解决方式:
    1. 试着先在终端 ping github.com
    MacBook-Pro:~$     ping github.com 
      PING github.com (13.250.177.223): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 Request timeout for icmp_seq 2 Request timeout for icmp_seq 3 
    • 如果 ping 出来是这种结果,就接着看第二步
    1. 修改 hosts 配置
      • 在终端中 sudo vi /etc/hosts 打开编辑文件
      • 按 s 进入编辑模式
      • 接着在最下面添加 192.30.253.113 github.com
      • 按 control + c 保存
      • 接着按 :wq 退出,就可以了。
    2. 在终端 ping github.com
      MacBook-Pro:~$     ping github.com
      PING github.com (
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值