問題描述
Mac 安裝 Homebrew 連接被拒絕
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
原因
國內安裝 Homebrew 需要FQ。
解決方案
先試試瀏覽器是否能打開 https://raw.githubusercontent.com/Homebrew/install/master/install,如果打不開,需要自行找個代理。
如果能打開,但是訪問還是被拒絕,查看自己的代理方式和代理端口,
如我的代理地址是 http://127.0.0.1:1087
,curl 用 -x 參數設置代理如下
$ /bin/bash -c "$(curl -fsSL -x http://127.0.0.1:1087 https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
然后可以下載和安裝了。