16

I ran gem update --system thinking it would solve a problem I was having, and now I can't run rails server. It won't load and instead, I keep getting the following. Can someone tell me how to undo this and revert back to before I ran the update?

I've already ran git checkout, but the problem persists...

/usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:187:in `stub_source_index170': uninitialized constant Gem::SourceIndex (NameError)
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:353:in `stub_rubygems'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:250:in `replace_entrypoints'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:14:in `setup'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler.rb:107:in `setup'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.7/lib/rubygems-bundler/noexec.rb:66:in `setup'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.7/lib/rubygems-bundler/noexec.rb:78:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:9:in `<main>'
ekremkaraca
  • 1,453
  • 2
  • 18
  • 37
nishacodes
  • 197
  • 1
  • 9

2 Answers2

38

I had the same issue today. Updating bundler to the latest version fixed the problem:

gem update bundler

And if you are running rbenv

rbenv rehash
bbonamin
  • 30,042
  • 7
  • 40
  • 49
  • This worked for me after seeing a similar error when trying to coax RubyMine to debug a ruby script (error like: stub_source_index170': uninitialized constant Gem::SourceIndex (NameError)). Just gem update bundler fixed it. – Mason May 09 '13 at 02:43
15

Seems like the latest version of Rubygems is buggy.

You just have to revert back to an older version with the following command and everything should work fine :

gem update --system 1.8.24
sevenseacat
  • 24,699
  • 6
  • 63
  • 88
Daniel Ristic
  • 710
  • 6
  • 16