1

I need help getting brew setup. I have tried reinstalling brew and ruby, but I feel like I am just making things worse.

Some information: OS X El Capitan V. 10.11.5

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15.5.0]

$ which -a ruby
/usr/local/bin/ruby
/usr/bin/ruby

When I try to update brew:

$ brew update
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'
Error: Git must be installed and in your PATH!

When I try to install ruby:

$ rvm install ruby
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'

Installing requirements for osx.
Updating system.......
Error running 'requirements_osx_brew_update_system ruby-2.3.0',
showing last 15 lines of /Users/Ben/.rvm/log/1467344813_ruby-2.3.0/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.

I have tried: https://stackoverflow.com/a/24789161/4459422

Please let me know what other information is needed to solve this problem, and thanks in advance for the help!

Community
  • 1
  • 1
iMacHumphries
  • 108
  • 1
  • 7

4 Answers4

10

For anyone reading this answers for me its not related to ruby. At least for me the answer is on the homebrew forum SMillerDev answer.

First try run:

brew update-reset

if that does not work run:

cd $(brew --repo)
git add .
git fetch
git reset --hard origin/master

hope this can help someone else.

Kanekotic
  • 2,824
  • 3
  • 21
  • 35
1

Try reinstalling ruby and to do so, type in following commands:

rvm fix-permissions

rvm reinstall 2.3.1
Nirupa
  • 787
  • 1
  • 8
  • 20
0

This command screwed me up: from https://stackoverflow.com/a/24789161/4459422

sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/1.8 
/System/Library/Frameworks/Ruby.framework/Versions/Current

I was using version 2.0 so updated to

 sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/2.0 
    /System/Library/Frameworks/Ruby.framework/Versions/Current
Community
  • 1
  • 1
iMacHumphries
  • 108
  • 1
  • 7
-1

You can actually install brew with system Ruby that ships with OSX. There shouldn't be any need to install Ruby from RVM to install brew.

Which version of OSX this is btw? And which version of ruby is system ruby? Also try brew doctor .