Tuesday, June 14, 2011

Rails : no such file to load -- devise/orm

If you're like me, you're getting this error while trying to get Devise set up. You google around and everything talks about mongoid or mongo_mapper, which you're not using.

Turns out the solution to this one is easy. Go into config/initializers/devise.rb and not this section:

# ==> ORM configuratio

# Load and configure the ORM. Supports :active_record (default) an

# :mongoid (bson_ext recommended) by default. Other ORMs may be

# available as additional gems

  require 'devise/orm/'

See it? When I read that I assume it meant that I could leave this alone and get active_record support. Apparently not. Change the line to read : require 'devise/orm/active_record' and see if your problem doesn't go away. Mine did! :)


sarabose said...

Thanks so much, this resolved my issue!Free Software Download

Anonymous said...

By changing the default
/devise/orm/active_record does not create any xxxx_devise_create_users.rb and user.model.rb and other important files when you run rails generate devise User . Is there another way around to it?

by: RG

whsu said...

thank you for this!! it definitely worked for me
this error was ticking me off

Anonymous said...

It worked! Thanks!

vinay said...

Thanks, it does solve the issue.