"loaded_specs" Gem Error

Posted by ryan
at 3:30 PM on Tuesday, May 13, 2008

For those of you that have run into this gem error when running the latest rails:

./script/../config/../vendor/rails/railties/lib/initializer.rb:175:in `install_gem_spec_stubs': undefined method `loaded_specs' for Gem:Module (NoMethodError)
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:175:in `reject!'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:175:in `install_gem_spec_stubs'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:89:in `send'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:89:in `run'
        from ./script/../config/boot.rb:46:in `load_initializer'
        from ./script/../config/boot.rb:38:in `run'
        from ./script/../config/boot.rb:11:in `boot!'
        from ./script/../config/boot.rb:109
        from script/dbconsole:2:in `require'
        from script/dbconsole:2

the solution is a quick and dirty:

gem update --system

Or, if you currently have rubygems v0.8.4 or earlier installed:

gem install rubygems-update
update_rubygems

Just a public service announcement from the “Ryan’s been bitten by this one” dept.

Comments

Leave a response

  1. Ryan DavisMay 13, 2008 @ 04:33 PM

    no @ on that first command.

    gem update --system
  2. RyanMay 13, 2008 @ 04:45 PM

    thanks, Ryan – a textile relic

  3. arieMay 13, 2008 @ 07:24 PM

    Hi Ryan,

    Thanks for keeping us up-to-date.

    how about this error, I always get this error when running RAILS_ENV=production script/about

    $ RAILS_ENV=production script/about /Users/arie/projectname/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant Rails::Info (NameError) from /Users/arie/projectname/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:455:in `const_missing' from /Users/arie/projectname/vendor/rails/railties/lib/commands/about.rb:2 from script/about:3:in `require' from script/about:3
  4. ltranJune 04, 2008 @ 01:17 PM

    updated to rails 2.1 and I’m getting same error (though line# is different). is there a fix for this that doesn’t involve updating gem? I’m on shared hosting (I upgraded to rails 2 on my dev machine, rake rails:freeze:gems, then uploaded to host). thanks

  5. Anthony EttingerJune 07, 2008 @ 05:54 PM

    Same issue here.