I ran into an issue recently to which the Googles had no answer for. I was updating a project gemset in rvm with a new project a coder buddy had pushed to Git when the strangest thing happened.
I did the bundle install and ran:
gem update --system
Instead of getting the normal output screen I got this instead.
ERROR: While executing gem ... (NoMethodError)
undefined method `version' for nil:NilClass
I tore my hair out for days then did a check on the RubyGems version in my gemset and compared it with the gemset on the remote project. My RubyGems version was 1.5.0 and the remote was 1.5.2. This is pure speculation but it looks like the local project bundle was expecting me to run system update from 1.5.2 and not 1.5.0.
Sooo, how do you fix this? In the spirit of Xzibit memes everywhere you need to update your update so you can update….dawg…
Install the RubyGems update gem via:
$ gem install rubygems-update # again, might need to be admin/root
Then run the upgrade
$ update_rubygems # ... here too
You should now be able to run your gem update --system with great success

Brugu
Thank You.
MG
This was a huge help. Thanks.
Nic Johnson
Oh Horray
I thought it was a gempath issue.
PandaWood
Thank you – saved my hair.
Rocco
Thanks from me as well. Worked like a charm.
Pulkit
Thanks
knudu
Thanks for this – helped me with exactly this issue.
Bill
Thank you. Saved me pulling out my hair too.
Anton
Thank you!
Peca
Thanks, saved few hairs I have on my head.
Ram
Thanks a lot, this saved me a lot frustration.
J
serious thanks!
Justin
You rock. This saved me a ton of time!
Jordan Maguire
Thanks for this.
Kevin
I appreciate this very much. Thank you.
Prasad Hande
Good catch and solution too much appreciated..
Jamie
Thanks so much!
Ted
You just saved my brain.
Phillip
Much appreciated! This was driving me nuts
Madhan
Awesome…thanks for ur help
Ranji
Hi,
I am getting “ERROR: While executing gem … (NoMethodError)
undefined method `spec’ for nil:NilClass” while installing gem
Can you please help me .
I followed the
Ed
Thank you!!!!!