当我尝试安装 Homebrew 时,出现以下连接被拒绝的错误。请帮我解决这个问题。
$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
当我尝试安装 Homebrew 时,出现以下连接被拒绝的错误。请帮我解决这个问题。
$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
对我来说没问题。除非这是一个真正的Github问题,但我猜它不是,很可能是你的连接出了问题。
您能通过浏览器访问相同的URL吗?
https://raw.githubusercontent.com/Homebrew/install/master/install
如果你在那里也遇到了错误,那么你就知道问题出在哪里了。(请与你的网络管理员交谈)ruby brew_install.rb
如果您在代理后面,请尝试以下操作:
sudo vim /etc/hosts
#在下面添加以下行并输入:wq
199.232.28.133 raw.githubusercontent.com
我遇到了公司代理问题,根据这里提供的解决方案,问题得以解决。
export HTTPS_PROXY=https://<proxy.mycompany>:<port>
git config --global https.proxy $HTTPS_PROXY
git config --global --get https.proxy
我遇到了同样的错误,
- 关闭VPN
再次尝试在没有VPN的情况下安装, 这次安装成功了。
这里有几种情况,你可以采取以下措施:
删除旧工具 ($ rm -rf /Library/Developer/CommandLineTools)
和 xcode-select --install
重新安装xcode命令行工具。https://raw.githubusercontent.com/Homebrew/install/master/install
的内容,并将其保存到shell文件中,然后运行它。8.8.8.8
(对我有效:])。最后,您应该运行 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
命令。
我曾在其他人的电脑上看到过这个问题,似乎只需安装xcode即可解决,具体操作是执行命令xcode-select --install