Fixing: uninitialized constant Gem::GemRunner (NameError) – Ubuntu
After upgrading to the newest version of rails (2.2.2) I was getting this error:
administrator@shuttle:~/$ gem -v /usr/bin/gem:10:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009. /usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)
Anytime I called “gem” I would get this error and could not get past.
Here is the fix
administrator@shuttle:~/$ sudo vim /usr/bin/gem
Change the top of the file to look like this:
require 'rubygems' require 'rubygems/gem_runner' #Gem.manage_gems
Save and when you run this you should see this:
administrator@shuttle:~/$ gem -v 1.3.1
You should no longer get the error with running “gem”
Posted on November 29, 2008 at 10:41 am by nickdenardis · Permalink
In: rails · Tagged with: code, fix, rails, upgrade
In: rails · Tagged with: code, fix, rails, upgrade

on December 9, 2008 at 8:34 pm
Permalink
Thaaanks Nick!!! You saved my hours of pain!!!
on December 15, 2008 at 1:24 pm
Permalink
Thanks, that’s really helped us out
Have a great XMAS too…
on December 20, 2008 at 3:06 pm
Permalink
Thank you I wish I found this earlier last night I was up going crazy.
on December 30, 2008 at 1:12 pm
Permalink
Thanks a lot, man!
on December 30, 2008 at 3:30 pm
Permalink
You are a life saver! I was ripping my hair out trying to get this working!
Appreciated!
on January 5, 2009 at 3:23 am
Permalink
Thanks..a lot….That saved a lot of time..!!!!
Thank you…again…
on January 11, 2009 at 2:23 pm
Permalink
You have saved me hours of pulling my hair out over this. Thank you.
on January 19, 2009 at 1:26 am
Permalink
thanks for posting this, fingers crossed but this seems to work with a Debian install as well.
on February 5, 2009 at 12:22 am
Permalink
yep, worked on debian etch package as well. was about to give up on my rails setup.
on February 10, 2009 at 3:36 am
Permalink
Hey, thanks, very useful, save me a headache.
on February 26, 2009 at 1:33 am
Permalink
Well, that got gem working again…Sort of. When I try sudo gem install rails-1.2.5 it gives the “cannot find this package anywhere” crap again.
on March 4, 2009 at 11:27 am
Permalink
Thank you very much… That is very usefull and save me hours.
on March 4, 2009 at 1:38 pm
Permalink
thank you very much………..its very helpful……
on March 4, 2009 at 3:15 pm
Permalink
[...] Englische Quelle ist hier zu finden. Tags: rubygems Posted in Ruby on März 4, [...]
on March 17, 2009 at 11:48 pm
Permalink
Thanks, works for me (Ubuntu / Linux 2.6.24-19)
on March 18, 2009 at 9:08 am
Permalink
Thank you so much!
on April 8, 2009 at 1:13 am
Permalink
Thanksa lot
on April 10, 2009 at 6:40 pm
Permalink
Thank you so much…I was completely stumped
on April 15, 2009 at 11:07 am
Permalink
Thank you!
on April 16, 2009 at 2:59 pm
Permalink
Thanks, it is rediculous that this has been left!!
on July 20, 2009 at 8:07 pm
Permalink
Thanks a bunch!
on January 17, 2010 at 2:33 pm
Permalink
Thank you, much !!
Width love? from Russia ! )))
on September 16, 2010 at 6:03 am
Permalink
Thanks a lot man