ruby Mac OS X 上的 Homebrew 安装无法连接到 raw.githubusercontent.com 端口 443
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29910217/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Homebrew installation on Mac OS X Failed to connect to raw.githubusercontent.com port 443
提问by Yosuva A
When I try to install Homebrew, I am getting following connection refused error. Please help me to solve this problem.
当我尝试安装 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
回答by Gal
Works for me. Unless its a real problem with github, which it may be but I'm going to guess that its not, its probably a problem with your connection.
对我来说有效。除非它是 github 的一个真正问题,它可能是,但我猜它不是,它可能是你的连接问题。
Can you get to the same URL via a browser?
您可以通过浏览器访问相同的 URL 吗?
https://raw.githubusercontent.com/Homebrew/install/master/install
https://raw.githubusercontent.com/Homebrew/install/master/install
If you get an error there too, you know what your problem is. (Talk to your network admin)
如果您在那里也遇到错误,您就知道问题出在哪里。(与您的网络管理员交谈)
If that works...maybe try doing just the "curl" command in your terminal to see if curl gives a more specific error?
如果可行……也许尝试在终端中仅执行“curl”命令以查看 curl 是否给出了更具体的错误?
Also, if that does work, save that file to a file on your computer (brew_install.rb) and then run it via
此外,如果这样做有效,将该文件保存到您计算机上的文件 (brew_install.rb) 中,然后通过
ruby brew_install.rb
回答by blueskin
It was a company proxy problem for me and the solution as mentioned hereworked for me.
这对我来说是一个公司代理问题,这里提到的解决方案对我有用。
export HTTPS_PROXY=https://<proxy.mycompany>:<port>
export HTTPS_PROXY=https://<proxy.mycompany>:<port>
git config --global https.proxy $HTTPS_PROXY
git config --global https.proxy $HTTPS_PROXY
git config --global --get https.proxy
git config --global --get https.proxy
回答by jmccure
I've seen this a few times on other people's machines and it seems to be fixed after you install xcode, i.e. xcode-select --install
我在其他人的机器上见过几次,安装xcode后似乎修复了,即 xcode-select --install
回答by NSKevin
There are several situations here, you can do following things :
这里有几种情况,你可以做以下事情:
- reinstall the xcode command line tool by
removing the old tools ($ rm -rf /Library/Developer/CommandLineTools)andxcode-select --install - request web page
https://raw.githubusercontent.com/Homebrew/install/master/installthen save it's content to shell file then run it. - change your DNS server to
8.8.8.8(This is worked for me : ] )
- 通过
removing the old tools ($ rm -rf /Library/Developer/CommandLineTools)和重新安装 xcode 命令行工具xcode-select --install - 请求网页,
https://raw.githubusercontent.com/Homebrew/install/master/install然后将其内容保存到 shell 文件,然后运行它。 - 将您的 DNS 服务器更改为
8.8.8.8(这对我有用:])
Finally you should run /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
最后你应该运行 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
回答by Hugo Correa
These steps solved the problem:
这些步骤解决了问题:
xcode-select --install- restart the Mac
Execute this command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
xcode-select --install- 重新启动 Mac
执行这个命令:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and it should work.
它应该工作。
回答by aiman24
Check is https proxy is set
检查是否设置了 https 代理
env|grep -I proxy
env|grep -I 代理
Then if it is set, remove the env variable
然后如果设置了,删除env变量
unset HTTPS_PROXY
取消设置 HTTPS_PROXY
回答by user5834756
I solved this problem by the following steps:
我通过以下步骤解决了这个问题:
1. removing the old tools ($ rm -rf /Library/Developer/CommandLineTools)
2. install xcode command line tools again ($ xcode-select --install).
回答by Ferenc Yim
The accepted Answer is outdated now. But based on the answer I solved the problem by:
接受的答案现在已经过时了。但根据答案,我通过以下方式解决了问题:
- open the home page of brew https://brew.sh/
- copy the URL from the install cmd and open it on your browser https://raw.githubusercontent.com/Homebrew/install/master/install.sh
- right-click and save it to your computer
- open a terminal and run it with: /bin/bash path-to/install.sh
- 打开brew主页https://brew.sh/
- 从安装 cmd 复制 URL 并在浏览器上打开它https://raw.githubusercontent.com/Homebrew/install/master/install.sh
- 右键单击并将其保存到您的计算机
- 打开终端并使用以下命令运行它:/bin/bash path-to/install.sh

