折腾:
【未解决】Win中VMWare中macOS虚拟机中安装homebrew
期间,先去参考之前帖子
【已解决】Mac中安装Python
先去给macOS安装brew,结果报错
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
结果报错:
crifanlideMac:~ crifanli$ /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

macos brew
是类似的:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
很明显会出现一样的问题的
crifanlideMac:~ crifanli$ /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
macOS虚拟机中是可以打开
的

所以不是网络问题。
macos curl 7 Failed to connect to raw.githubusercontent.com port 443 Connection refused
Homebrew | curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused_静心 Study-CSDN博客_curl: (7) failed to connect to raw.githubuserconte
先去用浏览器打开
结果此处无法打开:

此处暂时不想要单独下载rb文件
还是想要彻底搞清楚怎么回事
关于Mac下载brew报curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
安装homebrew报错curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation – 简书
然后发现:
【已解决】Windows中浏览器打开raw.githubusercontent.com报错: 错误代码 DNS_PROBE_POSSIBLE
然后再去macOS虚拟机中去试试:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
问题依旧。
那看来要去:
macOS中,加上hosts配置了。
mac hosts
直接
sudo vi /etc/hosts
加上:
# github 151.101.76.133 raw.githubusercontent.com
即可

然后保存后退出
crifanlideMac:~ crifanli$ cat /etc/hosts ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost # github 151.101.76.133 raw.githubusercontent.com
确认没问题。
再去试试
即可继续安装。
【总结】
此处,macOS中
/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
原因:
此处DNS被墙,导致无法访问raw.githubusercontent.com
解决办法:
找到raw.githubusercontent.com实际的IP,加到本地hosts配置中即可。
此处macOS中
vi /etc/hosts
再去加上:
# github 151.101.76.133 raw.githubusercontent.com
即可。
注:
关于寻找最新IP和如何刷新立刻生效,详见:
【已解决】Windows中浏览器打开raw.githubusercontent.com报错: 错误代码 DNS_PROBE_POSSIBLE
转载请注明:在路上 » 【已解决】Win中VMWare的macOS安装brew报错:curl 7 Failed to connect to raw.githubusercontent.com port 443 Connection refused