1
votes

After running any homebrew command I get the same error over and over......

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- extend/module (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/Library/Homebrew/global.rb:1:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/Library/brew.rb:16:in'

2
You need not install rails , you just need to install ruby . Have you tried using rvm ?Caffeine Coder
I tried running brew doctor, brew update, and even the uninstall instructions for homebrew i found online and I still get the same error.KPath001
you should never run sudo brew.. sudo gem ... keep everything in your user space!. To update ruby use 'ram' install rails ontop of user-space ruby. NEVER In SYSTEMThorstenC

2 Answers

1
votes

The best idea – use rvm. First of all reinstall homebrew. Then install rvm:

\curl -sSL https://get.rvm.io | bash -s stable

Then you need to provide ruby version and gemset. Go to app folder and create files .ruby-version and .ruby-gemset (including dot). Then add version and gemset in this files. Simple way to do it via console. In console, go to app directory, then:

echo ruby-2.1.3 >> .ruby-version
echo gemsetname >> .ruby-gemset

Of course, provide ruby version that you need. Gemsetname is often equal to app name. So, if your app is called coolapp, your gemsetname should be coolapp. Smth like this:

echo coolapp >> .ruby-gemset

Now, leave app directory and try to enter it again via console:

cd /path/to/your/app

RVM will generate everything you need automatically and you will see stmth like this:

ruby-2.1.3 - #gemset created /Users/username/.rvm/gems/ruby-2.1.3@coolapp
ruby-2.1.3 - #generating coolapp wrappers..........

Boya! This approach will provide same version and gemset name for every developer because files will be included in git. And that will decrease bug level. Everything you need from this moment, just use:

bundle install

And everything should goes right!

0
votes

I would recommend using rbenv or rvm to manage your development Ruby version and gems. Editing OS X's system Ruby could cause difficult-to-diagnose problems.

Also, you shouldn't need to sudo to install gems. You need to be very careful when sudoing a command since, again, it could cause difficult-to-diagnose problems with the operating system down the road.

So, I'd recommend you re-install homebrew, then install rbenv from git, then gem install away.