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”
Dec 09, 2008 @ 20:34:25
Thaaanks Nick!!! You saved my hours of pain!!!
Dec 15, 2008 @ 13:24:36
Thanks, that’s really helped us out
Have a great XMAS too…
Dec 20, 2008 @ 15:06:01
Thank you I wish I found this earlier last night I was up going crazy.
Dec 30, 2008 @ 13:12:20
Thanks a lot, man!
Dec 30, 2008 @ 15:30:08
You are a life saver! I was ripping my hair out trying to get this working!
Appreciated!
Jan 05, 2009 @ 03:23:14
Thanks..a lot….That saved a lot of time..!!!!
Thank you…again…
Jan 11, 2009 @ 14:23:29
You have saved me hours of pulling my hair out over this. Thank you.
Jan 19, 2009 @ 01:26:19
thanks for posting this, fingers crossed but this seems to work with a Debian install as well.
Feb 05, 2009 @ 00:22:35
yep, worked on debian etch package as well. was about to give up on my rails setup.
Feb 10, 2009 @ 03:36:28
Hey, thanks, very useful, save me a headache.
Feb 26, 2009 @ 01:33:25
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.
Mar 04, 2009 @ 11:27:19
Thank you very much… That is very usefull and save me hours.
Mar 04, 2009 @ 13:38:17
thank you very much………..its very helpful……
media-scientific - IT Blog » Blog Archive » Rubygems ERROR - Warning: Gem::manage_gems…
Mar 04, 2009 @ 15:15:35
[...] Englische Quelle ist hier zu finden. Tags: rubygems Posted in Ruby on März 4, [...]
Mar 17, 2009 @ 23:48:28
Thanks, works for me (Ubuntu / Linux 2.6.24-19)
Mar 18, 2009 @ 09:08:27
Thank you so much!
Apr 08, 2009 @ 01:13:23
Thanksa lot
Apr 10, 2009 @ 18:40:00
Thank you so much…I was completely stumped
Apr 15, 2009 @ 11:07:01
Thank you!
Apr 16, 2009 @ 14:59:59
Thanks, it is rediculous that this has been left!!
Jul 20, 2009 @ 20:07:27
Thanks a bunch!
Jan 17, 2010 @ 14:33:52
Thank you, much !!
Width love? from Russia ! )))
Sep 16, 2010 @ 06:03:40
Thanks a lot man