NameError: uninitialized constant Gem::SourceIndex
Solution 1
You need to update Bundler: gem update bundler
RubyGems release 2.0 seems to be the trigger for the error:
RubyGems 2.0 includes several new features and many breaking changes. Some of these changes will cause existing software to break. . . . If you are using bundler be sure to install a 1.3.0.prerelease version or newer. Older versions of bundler will not work with RubyGems 2.0.
Here are the issue details.
Solution 2
Run:
gem update --system 1.8.24
Sounds like there's something buggy with latest.
Solution 3
Have you tried updating your RubyGems?
gem update --system
Solution 4
Thanks!
Rails-7, ruby 3.1.2, had the same issue
solved it by gem update --system
Solution 5
gem update bundle && gem update --system
Related videos on Youtube
jamesfzhang
Updated on May 14, 2022Comments
-
jamesfzhang almost 2 years
This error appears for a new rails app, with nothing modified, when visiting the homepage (after successfully running
bundle install
).Here are the version numbers:
ruby: 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1]
rails: 3.2.12
rvm: 1.18.14
gem: 2.0.0
bundler: 1.3.0.pre.8
Calling
which ruby
returns/Users/J/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
, which seems fishy, right?-
Hans de Wit about 11 yearsGot the same error after upgrade from Ruby 1.9.3-p385 to 1.9.3-p392. Could it be a coincidence with some other change in my app?
-
Daniel Ristic about 11 yearsThis seems related
-
-
Codejoy about 11 yearssame error and yes it says: Latest Version currently installed. Aborting. Still get error.
-
plasticide about 11 yearsA colleague had updated to latest rubygems and was getting the same error as OP. I updated to latest to ensure that I got the same error. I did. I used the above answer to revert (to 1.8.25) and the error was resolved.
-
Carey Gregory about 11 yearsYou should copy the actual text of the answer here so your answer doesn't become worthless due to a broken link in the future.
-
Stuart M almost 11 yearsCan you elaborate on how it will fix the issue?
-
littleyang almost 11 yearsin your project root directory,using the commands,remember to use "bundle install"
-
Kadarach over 10 yearsThanks. Updated the answer.
-
ortonomy almost 2 yearsthis is the modern day real answer