4

I am running into an issue with running both rvm use ruby --install --default and brew update. It appears the later issue is the reason why I am seeing the first issue.

Here is the error for rvm use ruby --install --default:

ruby-2.1.2 is not installed - installing.
Searching for binary rubies, this might take some time.

Found remote file https://rvm.io/binaries/osx/10.9/x86_64/ruby-2.1.2.tar.bz2
Checking requirements for osx.
Installing requirements for osx.
Updating system......
Error running 'requirements_osx_brew_update_system ruby-2.1.2',
showing last 15 lines of /Users/connorphillips/.rvm/log/1408816616_ruby-2.1.2/update_system.log
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ rvm_pretty_print stderr
++ case "${rvm_pretty_print_flag:=auto}" in
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'Failed to update Homebrew, follow instructions here:
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ return 1
Requirements installation failed with status: 1.
Gemset '' does not exist, 'rvm ruby-2.1.2 do rvm gemset create ' first, or append '--create'.

I then try brew update and this is the error I'm seeing:

fatal: unable to access 'https://github.com/Homebrew/homebrew.git/': Could not resolve host: github.com
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

What is the source of the issue/fix it.

Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214
cphill
  • 5,596
  • 16
  • 89
  • 182
  • Are you on a VPN or something? You can't connect to github because your machine can't find it. May need to configure proxy settings. http://stackoverflow.com/questions/18290822/why-does-git-fetch-fail-with-could-not-resolve-host-nil-with-https-git – Brennan Aug 23 '14 at 19:27
  • @mu無 there is a difference between couldn't resolve host and ssl certificates. It means that it can't access to github.com at all – Loïc Faure-Lacroix Aug 23 '14 at 21:12
  • @cphill If you are behind a proxy, check [this answer](http://stackoverflow.com/a/20371843/1860929) – Anshul Goyal Aug 23 '14 at 21:15
  • Can you run `traceroute github.com` on your command line and post the output? – Aaron Brager Aug 23 '14 at 21:19
  • @Brennan not on a VPN and git is working when I make pushes to projects. Not sure why that would be an issue with trying to pull anything now – cphill Aug 24 '14 at 15:06
  • what's bizarre is that I can run `sudo brew update` and it updates and then I run `brew update` and it says everything is up to date and I don't run into any issues – cphill Aug 24 '14 at 15:30

2 Answers2

4

It might be a problem with Git. Just try to do this on a terminal:

git config --global --unset http.proxy 

git config --global --unset https.proxy 

and restart your terminal or open a new one. Then try brew update again.

Americo Savinon
  • 2,569
  • 1
  • 19
  • 16
3

I had a similar issue but was able to resolve it. Every time I tried to run brew update I'd get this error:

fatal: unable to access 'https://github.com/Homebrew/homebrew.git/': Could not resolve host: github.com
Error: Failure while executing: git pull --quiet origin refs/heads/master:refs/remotes/origin/master

My issue was that I was using a VPN, but after turning it off it worked for me.

Mosab Sasi
  • 1,130
  • 8
  • 11