RubyGems: undefined method ‘manage_gems’ for Gem:Module (NoMethodError)

After updating RubyGems I got the following error message:

1
2
/usr/bin/gem:10: undefined method `manage_gems' for Gem:Module (NoMethodError)
#

Nice. So I took a look at the output that was generated and came across this:

1
2
3
4
Deprecation Notices:

* Gem::manage_gems has been removed.
* Time::today will be removed in RubyGems 1.4.

Now what? Right – fix it.

1
sudo vim /usr/bin/gem

Search “Gem.manage_gems” and remove it or replace it with

1
#Gem.manage_gems

Unfortunately i got this

1
2
/usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)
#

when running the gems command. After “googling” I came up with this:  

1
sudo vim /usr/bin/gem

inserting

1
require 'rubygems/gem_runner'

so that the first lines of /usr/bin/gem look like this 

1
2
3
require 'rubygems'
require 'rubygems/gem_runner'
#Gem.manage_gems

Fixed.

Tags: , , , ,

48 Responses to “RubyGems: undefined method ‘manage_gems’ for Gem:Module (NoMethodError)”

  1. Thx. It solved my problem.

  2. Juan Carlos says:

    Thanks!! It works for me too!

  3. pililo says:

    Thanks

    =)

  4. Rexar says:

    Thanks a lot man !

  5. David says:

    Thanks 2!!!

  6. feby says:

    You’re my hero :-)

  7. Doug says:

    Thanks a ton.

  8. Jessie says:

    Great !
    Problem solved on Ubuntu / ruby 1.86
    Thanks !

  9. Pablo says:

    Just what I was looking for!! Thank you very much.

  10. psynaptic says:

    Nice one, fixed my issue and allowed me to install a specific version of rails. Thank you!

  11. Mark says:

    Worked here too. Dumb bugs! hahah

  12. Bill says:

    That did the trick on Xubuntu 8.04. Thanks for the gem.

  13. akimo says:

    thank you for this fix. that saved my day!

  14. Wouter says:

    Tnx!

  15. Raviraj says:

    Thank a lots

  16. Aashish says:

    Thanks a bunch!

  17. Vellingiri says:

    I really thanks for your effort on this. I also faced this problem. I went through your modification wherever is needed. It works fine for me. Thanks man.

  18. angel says:

    Thanks a lot!

    Respect!

  19. Terry says:

    Thanks! It worked for me too. Good on ya for sharing.

  20. Ignacio says:

    Thanks man! You rock

  21. Noboru says:

    Thank’s that helped

  22. Adam DiCarlo says:

    Hmm, couldn’t you just replace /usr/bin/gem with /usr/bin/gem1.8? That’s what got installed by update_rubygems.

    To fix it I just did:
    sudo mv /usr/bin/gem1.8 /usr/bin/gem

  23. lfat says:

    thanks so much!!!

  24. Shane says:

    Thanks for the info!

  25. Ansuman says:

    very logical..: )

  26. Sim says:

    Thanks a bunch!!

  27. phil says:

    thx saved my day!

  28. parth says:

    Thanks a lot for posting the solution to this issue!

  29. Edi says:

    Thanks!

  30. chemaff says:

    Thanks!! :-)

  31. Charles says:

    Yay, thanks.

  32. umpirsky says:

    Man, this is awesome. i saw this post previously, but blog theme is vired and I didn’t saw explanation text at all :)

  33. Mr Anderson says:

    Thanks, that’s what I was looking for. ;)

  34. Raul says:

    Thanks ,very good to do

  35. Miguel says:

    Thanks! it worked for me and I’m a total noob…

  36. Java says:

    Didn’t. Ruby sucks.

  37. Jaroslav says:

    Thanks! Muchas gracias!

  38. Bless says:

    Thanks. But how do you know this is the one that need to be written?

  39. Greg says:

    Very nice.

  40. John says:

    Thanks! Your still saving people with this tip! Found this on 3 Ubuntu 8.04 boxes today, couldn’t figure out what to do until I found your fix.

  41. Dewd says:

    You r da walrus! I wasted an evening,.. and then found yr post. Now all is sunshine and champagne! Guys like you need a medal (or a holiday in the Pacific with a bevy of babes!). Cheers, Man!

  42. Jonathan says:

    Thanks. This happened to me today seven months after your post. Which makes me wonder, how come the code has not been fixed.

    A number of curious people might have been put off Ruby during their very first encounter.

    Thanks again, this kind of issue drives me mad. If only it just worked.

  43. UmitOz says:

    This helped me to solve my problem while upgrading from rails 1.2.3 to 1.2.6. Thanks.

  44. Thanks for that. It’s done the trick – I need things to Just Work to get by my boss and was beginning to get very annoyed at Ruby today!

  45. Marcel says:

    On ubuntu hardy, I found this happened after doing “gem update –system”, which seemed to update /usr/bin/gem1.8 but not /usr/bin/gem. So I fixed this way instead:

    rm /usr/bin/gem
    ln -s /usr/bin/gem1.8 /usr/bin/gem

  46. Jonathan says:

    Brilliant! Thank you!

  47. Krzsyztof Niemkiewicz says:

    Thanks !! Great post.

Leave a Reply