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

今天要安装那个brew(老实说,我还不知道brem是啥),然后根据网上的帖子操作还是报错了。

1.在终端执行下载命令

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

然后报错了

caideyao@caideyaodeMacBook-Pro Desktop % 
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /Users/caideyao/Maven/config/apache-maven-3.6.3/bin in PATH, mode 040777

2.出现这个问题的原因是GitHub的raw.githubusercontent.com域名解析被污染了。

解决办法

查询真实IP

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

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused_第1张图片

修改hosts

sudo vim /etc/hosts

添加如下内容:

199.232.68.133 raw.githubusercontent.com

参考博客

你可能感兴趣的:(mac,brew)