Rails 3 Problem: no such file to load -- rails (LoadError)

I just ran the gem bundle on the third_rails demo app, but for some
reason rails can’t be loaded!?

kristian-mandrups-macbook-pro:third_rails kristianconsult$ rails -v
Rails 3.0.pre

kristian-mandrups-macbook-pro:third_rails kristianconsult$ script/
generate model Post name:string
71:in require': no such file to load -- rails (LoadError) from /Users/kristianconsult/my_rails/rails3_apps/third_rails/config/ boot.rb:71:inload_initializer’
from /Users/kristianconsult/my_rails/rails3_apps/third_rails/config/
boot.rb:44:in run' from /Users/kristianconsult/my_rails/rails3_apps/third_rails/config/ boot.rb:16:inboot!’
from /Users/kristianconsult/my_rails/rails3_apps/third_rails/config/
from script/generate:2:in require' from script/generate:2 kristian-mandrups-macbook-pro:third_rails kristianconsult$ script/ console /Users/kristianconsult/my_rails/rails3_apps/third_rails/config/boot.rb: 71:inrequire’: no such file to load – rails (LoadError)


You need to bundle your rails into the Rails 3 app. Did you do that?

Also make sure that if you use multiple versions of Ruby, you will
need either to re-bundle your gems under the one you decided to use
after switching, or to add a symlink in vendor/gems/ruby.

Hope it solves the problem.


On Wed, Jan 20, 2010 at 3:06 AM, Kristian [email protected] wrote:

   from /Users/kristianconsult/my_rails/rails3_apps/third_rails/config/

71:in `require’: no such file to load – rails (LoadError)


If you’ew using Rails 3.0.pre, then I would recommend doing the

  1. follow the instructions here first

    Ruby on Rails — Getting a New App Running on Edge

a) see if similar ticket exists here


b) if (a) exists, then add your comments to that ticket. Otherwise,
file another ticket providing the following:

 -  ruby version (i.e. ruby -v)
 -  OS  version
 -  the exact steps to recreate the issue in a understandable 


Lastly, I would recommend the above steps for all people interested
Rails 3.0.pre because these types of issues
need to be made aware to the Rails core team.

Good luck,