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

参考 https://www.jianshu.com/p/c2e829027b0a

报错信息就是 安装 Homebrew 打不开这个地址 https://raw.githubusercontent.com

我用的方法一:记录下

1.打开网站 https://www.ipaddress.com/
  查询一下 raw.githubusercontent.com对应的IP 地址

2. 找到 /etc 目录下 的 hosts 文件,复制出来 修改,在后面添加 如下:

然后用修改的文件替换 /etc 目录下的 hosts 文件

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

3. 在命令行 输入命令安装

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

中间会出现一个 Press RETURN to continue or any other key to abort, 按回车键

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

当出现这样就说明已经在安装了,到此就解决问题了