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

760 阅读1分钟

使用mac 安装 brew 或者 Oh My Zsh 等会遇到以下问题:

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

今天总结一下如何解决:

1.打开 www.ipaddress.com/ 输入访问不了的域名,获得的结结果如下:

2.在本机的 host 文件中添加,建议使用 switchhosts 方便 host 管理

switchhosts:oldj.github.io/SwitchHosts…

3.将第二步查到的ip添加到host文件中

199.232.96.133 raw.github.com
199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com

添加以上几条 host 配置,homebrew 也能装了,nvm 也行动灵活了,Oh My Zsh也可以用了