curl: (7) error when i try installing Homebrew on iMac - macos

Setup iMac OSX 10.7.4,
Hi there,
I am trying to install Homebrew on my iMac but I keep getting an error. I am following the instructions on https://github.com/mxcl/homebrew/wiki/installation
I have Xcode installed and the Java Developer update which it specifies on the website.
I open Terminal and paste
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
But I keep getting the error
curl: (7) couldn't connect to host
Has anyone any suggestions?
EDIT:
Just to add I am on a college network incase its relevant
EDIT: I have also reinstalled Curl

For my specific case, I use SOCKS proxy for all traffic. So my installation command is:
ruby -e "$(curl -fsSL --socks5 127.0.0.1:30000 https://raw.github.com/mxcl/homebrew/go)"
where 127.0.0.1:30000 is the SOCKS proxy.

Something is blocking your connection to github. Try accessing the url https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb in your browser.

My issue was Curl not being configured to bypass my proxy.
One of they guys here in the office sorted it out for me. From what I understand the settings on curl had to be changed and not the proxy.
Hopefully this will help others in future.

I too had same problem.
The recipe for proxies should add --noproxy after curl statement
ruby -e "$(curl --noproxy -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

I also ran into this error and in my instance it was because my firewall was blocking or preventing outbound connections to Japan where it was trying to pull down the ruby version. Once the firewall rule was adjusted to allow the connections to that country everything worked fine.

Related

Homebrew: "curl: (60) SSL certificate: unable to get local issuer certificate"

I was trying to install Homebrew and then Tensorflow on my Mac. After typing the following command
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(from Homebrew) to the terminal, I got the following error message:
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html
Update: The Mac version is OS X El Capitan 10.11.5
ps. I would really appreciate if you could provide me a solution with some explanation. This is the first time I use a Mac OS.
It seems that your curl encountered a few issues with the certificate validation. You can skip it by enabling the -k option:
/usr/bin/ruby -e "$(curl -fsSLk https://raw.githubusercontent.com/Homebrew/install/master/install)"
I had a similar issue with git after upgrading to High Sierra.
These steps solved it for me:
Visit the website that is causing problems in Safari.
Look at the details of the certificate (especially the items higher up in the trust chain).
Open Keychain Access, find those certificates.
For each one, expand the "Trust" section and select "Always Trust" (only if you really do trust them of course ;-))
That solved it for me.
I had the exact same symptoms and spent the whole day digging around. Turned out my curl was broken because HTTPS_PROXY was set to something else.
My solution was
export HTTPS_PROXY=""
If anyone is finding the same problem running CURL from PHP, the equivalent to #Thomas Ayoub's answer is to use:
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
It would still be great to find out if there's a way to update PHP's CA files (or whatever it needs) to pick up the certificates required.

Cannot login to heroku

When I try to login to my heruko account it says:
Post
https://api.heroku.com/login?username=xxxxxxx%40gmail.com&password=XXXXXXXX:
dial tcp: lookup api.heroku.com on 127.0.1.1:53: cannot unmarshal DNS
message
I'm using Linux Mint 17.2
I resolved this problem by un-installing the current Heroku Toolbelt and re-installing it.
First Uninstalled-
sudo apt-get --purge remove heroku-toolbelt
Then, installed-
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
I had similar issue and could solve it by the above process.
Hope this will help as an answer to most of the question/s related to this error.
I was facing the same issue, but after some digging , i resolved it by modifying my DNS
DNS to 8.8.8.8.
It worked like a charm thenafter.
I solved my problem using this:
sudo su
heroku login
I don't know why but I removed non-aplhanumeric characters from my password (ie I changed my password to not include them), and it worked.
Just to clarify: a password like passw0r8$#% works on the website but not the command line, but passw0r8 does work on the command line.
I tried everything above and nothing worked. What got it working for me was adding this line to my /etc/hosts:
23.21.149.112 api.heroku.com
I came cross this issue also,finally I solved it by heroku update and use a proxy.I guess this is kind of net-trouble.
I just encountered this problem,it took me half a day to solve it .As a beginner,I worked in Ubuntu 15 ,using Python 2.7. (Google was blocked because of GFW.)
Just Three steps.
1.Modify The password only composed of letters and numbers,contain no "?","_","*","&"etc.
2.I have tried DNS "8.8.8.8""8.8.4.4""114.114.114.114",but failed.
I modified DNS for "223.5.5.5" "223.6.6.6"(alidns) terminally.
( ~$ sudo vi /etc/resolv.conf
Then modify 'nameserver xx.xx.xx.xx' and save.)
Use ~$ heroku auth:login

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

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
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
If you are behind a proxy, try this:
sudo vim /etc/hosts
#add the line below and :wq
199.232.28.133 raw.githubusercontent.com
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
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
I had the same error,
- Disabled VPN
tried again installing without VPN
It worked for me.
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) and xcode-select --install
request web page
https://raw.githubusercontent.com/Homebrew/install/master/install
then save it's content to shell file then run it.
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)"
First try to open the link in the browser if it doesn't open then changing the DNS is the answer.
For me changing the DNS to 8.8.8.8 worked for me.
DNS settings can be searched for in the system setting which can be launched through spotlight in Mac OS and then changed.
This solved the pertinent issue for me.
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
The method of using ruby is probably outdated, as shown below:
As a better alternative, please set your computer's DNS server to 8.8.8.8
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.
Check is https proxy is set
env|grep -I proxy
Then if it is set, remove the env variable
unset HTTPS_PROXY
I solved this problem by the following steps:
removing the old tools ($ rm -rf /Library/Developer/CommandLineTools)
install xcode command line tools again ($ xcode-select --install).
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)
I solved it.
You can visit https://github.com/Homebrew/install/blob/master/install.sh to get this install.sh by copy the whole contents.
Then paste it into install.sh and run sh install.sh.
A combination of what #blueskin mentioned first and then what #Ferenc Yim mentioned is what worked for me.
The script also requires sudo access (not necessarily run with a sudo prefix just need admin access)
sudo vim /etc/hosts
Once the vim code editor is open add the following line at end of the file
199.232.68.133 raw.githubusercontent.com

Error while installing RVM using Curl in Ubuntu 14.04

I was trying to install RVM using Curl in Ubuntu 14.04.
I ran the following command:
\curl -sSL https://get.rvm.io | bash -s stable
And got the following error:
curl: (7) Failed to connect to get.rvm.io port 80: Network is unreachable
Any help to resolve this issue is highly appreciable. Thanks
Try this before execute curl:
echo ipv4 >> ~/.curlrc
curl is used to download files via HTTP much like wget and it means that a connection to the remote site is failing which is why it is unable to download. Saw this on another forum,
give it a shot and see if it works for you:
"replace the get.rvm.io part with raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -it's the same script, just takes out some potential DNS problems on rvm's end"
Refere to this link https://www.digitalocean.com/community/questions/how-to-install-ruby-on-rails

Git Bash on windows 7 behind proxy no longer working

I'm on a windows 7, 32 bit box, and working behind a proxy. I just upgraded my git client (Git Bash) to Git-1.8.3-preview20130601, and all of the sudden, I'm getting the following error whenever I try to push/pull:
fatal: unable to access 'https://github.com/User/simple_timesheets.git/:
Received HTTP code 407 from proxy after Connect
I was able to do this just fine before upgrading, and even when I tried to revert back to the last version that I think I had, I still get the error. When I run git config -l, it lists out the following variables (among others):
user.name=MyName
user.email=My#email.com
http.proxy=http://user:password#server:port
core.autocrlf=true
https.proxy=http://user:password#server:port
http.sslcainfo=/bin/curl-ca-bundle.crt
What's odd is that I seem to be able to use the Git Bash client to curl just fine
curl finance.yahoo.com --proxy http://user:password#server:port
and can even curl into a dummy https site I set up on my computer:
curl https://localhost:3000 --insecure
Any ideas what I'm missing? Thanks
EDIT:
I could be wrong, but I think there might be an issue with curl in version 1.8.3. I uninstalled all git related applications I could think of on my computer, and installed Git-1.8.0-preview20121022, ran a pull on a repo and was successful.
For giggles, I uninstalled the working version, and kept the cert file; then reinstalled version 1.8.3 to see if this didn't have anything to do with it, but I got the same error I was originally trying to resolve.
Also, after re-installing version 1.8.0, I tried to curl an https website (gmail), with the following command: curl https://www.gmail.com --proxy http://user:pass#server:port, which was successful. When I did this under 1.8.3, I got an error about code 407. The version switch seems like it solved this.
I had the same issue resolved it by using two proxy filters:
"--proxy or -x" and "--proxy-user".
curl -x http://proxyserverurl:port --proxy-user username:password -L http://url
Though what you have tried is also not wrong but might not be compatible with your curl version.
Hope this helps!
I had the same issue. Exporting the environment variables https_proxy and http_proxy resolved the issue. So I ended up adding the following lines to the .bashrc file in the home directory:
# Configure proxy settings
export https_proxy='http://myproxy.example.com:8086/'
export http_proxy='http://myproxy.example.com:8086/'

Resources