Error installing homebrew on mac (curl: (6) Could not resolve host: raw.githubusercontent.com)

谁说我不能喝 提交于 2019-12-09 10:01:54

问题


I am trying to following instructions on homebrew homepage but the following

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

returns the following error:

curl: (6) Could not resolve host: raw.githubusercontent.com

Any suggestions?


回答1:


If you happen to be behind a proxy, You might need a way out, to exit

export http_proxy=http://YOURPROXY:PORT export ALL_PROXY=$http_proxy

For some other users, setting back their github https and https-proxy to default works sometimes as well.

git config --global --unset http.proxy
git config --global --unset https.proxy



回答2:


You are most probably behind a proxy. Consider running curl command with -k parameter:

-k, --insecure (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" fail unless -k, --insecure is used.

See this online resource for further details: http://curl.haxx.se/docs/sslcerts.html

Check also Homebrew docs where they talk about this.




回答3:


For people facing this problem I had resolved it by adding a new name server into network configuration.

Click on "System Preferences" then "Network", "Advanced" , "DNS", "+" and enter IP of the new name server, a good public name server is "8.8.8.8" .




回答4:


If non of the above solutions worked and you can't ping https://github.com/ or any other websites with your terminal ,it is because of an application that monitors and controls the access of network , so make sure that your terminal is not blocked from accessing the network by any Firewalls.




回答5:


It gave an error on the first attempt. However, it was installed on second attempt. The solution is to retry attempting the call.




回答6:


Setting proxy with Username, password and port number worked for me

 export http_proxy=http://<MacUser>:<MacPass>@proxy.muc:<ProxyPort>
 export https_proxy=http_proxy

After that simply execute

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


来源:https://stackoverflow.com/questions/27761799/error-installing-homebrew-on-mac-curl-6-could-not-resolve-host-raw-githubus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!