安装brew命令遇到问题

安装brew遇到如下报错信息:
ruby brew_install.rb                                                                              
Warning: The Ruby Homebrew installer is now deprecated and has been rewritten in
Bash. Please migrate to the following command:
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

有两种解决办法:

第一种:

  先在浏览器输入这个地址:https://raw.githubusercontent.com/Homebrew/install/master/install打开上面那个网址之后,将网页的内容保存为brew_install.rb,位置不固定,随便;

  然后输入curl命令,输出:curl: try 'curl --help' or 'curl --manual' for more information,有这个就说明没有问题了;最后再输入ruby brew_install.rb

第二种:

  由于某种原因,导致github的raw.githubusercontent.com域名解析被污染了,所以,需要通过修改hosts解决这个问题;

查询真实IP

在https://www.ipaddress.com/查询raw.githubusercontent.com的真实IP

在这里插入图片描述

修改hosts

sudo vim /etc/hosts

添加如下内容

199.232.28.133 raw.githubusercontent.com
欢迎关注我的微信公众号,里面有很多干货,各种面试题
在这里插入图片描述

发布了222 篇原创文章 · 获赞 20 · 访问量 22万+

猜你喜欢

转载自blog.csdn.net/qq_17555933/article/details/104666615
今日推荐