问题
When I try to install Homebrew, I am getting following connection refused error. Please help me to solve this problem.
$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
回答1:
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.
Can you get to the same URL via a browser?
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?
Also, if that does work, save that file to a file on your computer (brew_install.rb) and then run it via
ruby brew_install.rb
回答2:
It was a company proxy problem for me and the solution as mentioned here worked for me.
export HTTPS_PROXY=https://<proxy.mycompany>:<port>
git config --global https.proxy $HTTPS_PROXY
git config --global --get https.proxy
回答3:
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
回答4:
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)"
and it should work.
回答5:
Check is https proxy is set
env|grep -I proxy
Then if it is set, remove the env variable
unset HTTPS_PROXY
回答6:
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).
来源:https://stackoverflow.com/questions/29910217/homebrew-installation-on-mac-os-x-failed-to-connect-to-raw-githubusercontent-com