Fix for “uninitialized constant Gem::GemRunner (NameError)”

Monday, December 31st, 2007

I tried upgrading my version of rubygems to the most current version by running
sudo gem update --system
Which introduced this error:
/usr/bin/gem:23: uninitialized constant Gem::GemRunner(NameError)
whenever I tried to run rubygems. On the rails forum, I found a fix for it!
Simply add the line to the file /usr/bin/gem (may be different on a mac)
require 'rubygems/gem_runner'
after
require 'rubygems'
This fixed the issue in both Ubuntu and OS 10.4.

60 Responses to “Fix for “uninitialized constant Gem::GemRunner (NameError)””

  1. raggi

  2. Thanks, this helped me (once I figured out that the file I’m adding it to is /usr/bin/gem that is :)

    Hurt Reynolds

  3. Great fix!

    Syntaxius

  4. found your tip via google. that helps. thanks ~

    wilcohol

  5. Thanks Nick - that was a big help! Any ideas why this bug exists in Ubuntu? I’m using 7.10.

    -Dave

    Dave

  6. Thanks, I had the same problem and this fixed it for me as well. I’m using Ubuntu 7.04.

    -Aric

    Aric

  7. @hurt - Thanks. I made a change to reflect the appropriate file for Ubuntu.

    @Dave - I’m not sure. I was experiencing the same issue in OSX, so I think it was a bug in the gem software.

    Nick

  8. thanks! Great Help

    ochko

  9. THANKS!

    Rizwan Reza

  10. Worked on Mac 10.5

    you rock.

    philip

  11. 10x! saved me a lot of time! :)

    slony

  12. Super. Worked for me as well.

    Ubuntu ver 7.04

    ktheking

  13. hi, found this via google. had this bug on freebsd 6.2-release, too.

    britneyfreek

  14. Thank You !!!

    4-No0!3-15

  15. Thanks!

    Donnie

  16. Thanks a lot! Just what I needed.

    Lenart

  17. Thanks :D You’re a lot of people’s hero.

    Ed Anderson

  18. thank you!

    assente

  19. I know it’s a little redundant, but thank you!

    Calvin

  20. Thanks - yet again. Very fast find and fix.

    Mike Lunt

  21. Thanks

    Hugo

  22. Thanks, this worked with Solaris on Joyent too!

    Luke Noel-Storr

  23. thanks much for this!

    Jason

  24. THANKS!

    Sebastian

  25. Oh yeahh! It`s works

    mikahilov

  26. Wow, you save me so mutch time !

    Thank you!

    Carl

    Carl Pelletier

  27. Yet again: thanks!
    I just tried Ubuntu 7.10 for the first time and its great - except for this little bug.

    JohnB

  28. Thank you!

    chris

  29. That worked for me…. many thanks!!

    Zack

  30. Thanks… great help! Solved in Ubuntu Ultimate Edition.

    ffteixeira

  31. Thank you!!!!

    Cristiano87

  32. Thanks. Worked for me on a fb dev Joyent Accelerator running Solaris after updating to RubyGems 1.0.1.

    Erik P

  33. Thanks a lot!..

    grkn

  34. Thanks! Had this problem when updating a Debian box.

    hutchman

  35. found via google. Thanks!

    dave

  36. Thanks, worked for me in Ubuntu 7.10

    Denis

  37. Thanks for posting this– found via Google and it fixed my problem.

    Brandon Harper

  38. Google led me here, you’re number one for this error! Thanks a lot!

    Kolja

  39. Really thx!

    Dzs

  40. Thanks for posting this!

    Chris

  41. Thank you sir!

    Works… phew… Back to rails now… :D

    Raju

  42. Thanks… That Worked

    Frank

  43. You have resolved my problem.
    Really thank you.

    Riccardo Solimena

  44. Nice!
    Thank you.

    Kosh

  45. tkstkstks!

    fotanus

  46. great — very helpful — good work

    tim

  47. Nice. Worked for me. Thanks.

    Marcus

  48. Thanks a lot - got things working again

    Tyler

  49. excellent. cheers for post

    Andy GOUNDRY

  50. 10x a lot, found you by google :)

    Portal

  51. Thanks for this - happy again.

    UK Credit Fraud

  52. Your fix should be ranked so much higher on Google. I went through so much shit, before I got to your solution. Did it and it worked fine! Thanks.

    Word of advice to my fellow n00bs. If you can’t edit the file it’s because of permissions. Open up a terminal. Go to the folder where it’s located. Then type:
    sudo gedit gem

    Zach

  53. Thanks! … my system was broken.

    Todd

  54. Works on SuSE 10.3 and you’re still 1st hit on Google. Thanks for posting the fix.

    James

  55. Thanks! Google got me here too. Easy fix saved much time.

    Ken Weiner

  56. THANK YOU!

    brittany

  57. thanks! that helps!!

    zain alabdin tawfiq

  58. Great Fix!! Thanks!

    rugger

  59. works! thanks a lot for the help.

    Omar Bohsali

  60. I’m the 1234th person to say thanks man.

    now get off this wordpress garbage and on to a real blog platform… mephisto or typo :-)

    thanks again.

    nerb

Leave a Reply