47

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?

jamesfzhang
  • 4,403
  • 8
  • 32
  • 43
  • Got 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? – Alex Kovshovik Feb 25 '13 at 17:50
  • 3
    [This](http://stackoverflow.com/questions/15079182/cant-run-rails-server-after-accidentally-running-gem-update-system/15090490#15090490) seems related – Daniel Ristic Mar 06 '13 at 10:05

6 Answers6

57

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.

Dogweather
  • 15,512
  • 17
  • 62
  • 81
  • 2
    You should copy the actual text of the answer here so your answer doesn't become worthless due to a broken link in the future. – Carey Gregory Apr 10 '13 at 22:46
  • 6
    Its now Sep. 8th 2022 and this somehow still applies. Ruby is 3.1.2. Bundler is at 2.3.7 but the latest is 2.3.22. Rails is at 7.0.3.1 but when it does `bundle install` during a `rails new`, I get the same `uninitialized constant Gem::Source (NameError)` error. `gem update bundler` solved my issue. – pedz Sep 08 '22 at 22:23
29

Thanks!

Rails-7, ruby 3.1.2, had the same issue

solved it by gem update --system

chmich
  • 834
  • 9
  • 20
18

Run:

gem update --system 1.8.24

Sounds like there's something buggy with latest.

Tylerc230
  • 2,883
  • 1
  • 27
  • 31
  • A 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. – plasticide Apr 03 '13 at 17:14
15

Have you tried updating your RubyGems?

gem update --system
muttonlamb
  • 6,341
  • 3
  • 26
  • 35
3
gem update bundle && gem update --system
Jared
  • 25,627
  • 7
  • 56
  • 61
littleyang
  • 41
  • 2
0

For me it was all of the above + using the new one on my nginx config.

geermc4
  • 578
  • 6
  • 18