Homebrew installation on Mac OS X Failed to connect to raw.githubusercontent.com port 443

前端 未结 12 561
被撕碎了的回忆
被撕碎了的回忆 2021-02-01 22:48

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.github         


        
相关标签:
12条回答
  • 2021-02-01 23:05

    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

    0 讨论(0)
  • 2021-02-01 23:07

    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
    
    0 讨论(0)
  • 2021-02-01 23:08

    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

    0 讨论(0)
  • 2021-02-01 23:09

    Although saving the shell file locally and then running it can solve this problem, but you'll meet it again when you do something similar(e.g. install oh-my-zsh, vim-plug, etc.)

    At last, I find the 3rd item of this answer(https://stackoverflow.com/a/61787208/5458745) works best for me, as it can also solve the problem I meet when installing other tools using curl. However instead of changing the DNS, I add 8.8.8.8 to my original DNS server list, which works fine for me.

    Change your DNS server to 8.8.8.8 (This is worked for me)

    0 讨论(0)
  • 2021-02-01 23:14

    There are several situations here, you can do following things :

    1. reinstall the xcode command line tool by removing the old tools ($ rm -rf /Library/Developer/CommandLineTools) and xcode-select --install
    2. request web page https://raw.githubusercontent.com/Homebrew/install/master/install then save it's content to shell file then run it.
    3. change your DNS server to 8.8.8.8 (This is worked for me : ] )

    Finally you should run /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    0 讨论(0)
  • 2021-02-01 23:14

    Check is https proxy is set

    env|grep -I proxy

    Then if it is set, remove the env variable

    unset HTTPS_PROXY

    0 讨论(0)
提交回复
热议问题