On rails 7 new uninitialized constant Gem Source…

On rails 7 new:

uninitialized constant Gem::Source (NameError)

(defined?(@source) && @source) || Gem::Source::Installed.new

bundler (2.3.8, default: 2.3.7)

Solution was to `gem update bundler`
bundler (2.3.11, 2.3.8, default: 2.3.7)

2 responses to “On rails 7 new uninitialized constant Gem Source…”

  1. I had same error I believe but your solution didn’t work..

    #<NameError: uninitialized constant Gem::Source

    (defined?(@source) && @source) || Gem::Source::Installed.new

    Instead solution was to: bundle update –bundler

    I am a self-taught beginner so would appreciate if you could explain the difference or if this helps anyone else 🙂

  2. Honestly, if your project is small enough for `bundle update –bundler` to not cause so many dependency updates that it’s hard to track, that might be the better option. The problem I have run into with large applications, especially ones built on custom Continuous Integration environments on Jenkins or Buildkite, is that the bundler in the builder image is always a little out of date and you get all kinds of bundler version warnings.

    My solution is only updating the bundler gem on the system. (I often would probably do `gem uninstall bundler` instead and then `gem install bundler -v 2.3.11`)

Leave a Reply

%d bloggers like this: