I\'m getting error from devise \"User does not respond to \'devise\' method\" when running \"rails generate devise:install\". Ideas re how to resolve?
In fact also get
It sounds like you already have the devise method being called in your User model. Perhaps you already ran rails g devise User
?
Comment that out, and comment out the devise_for :users
line in your routes file, if that is in there.
i had this same problem. however for me it was caused by a conflict with the active_reload gem. once i removed that all was well. i got the tip from https://github.com/plataformatec/devise/issues/1597
For people that arrived here due to the following error:
User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application definition in 'config/application.rb' (RuntimeError)
but you already have your ORM initialized properly, it may be gem related. I was getting the same problem on an old app and it was due to an incompatibility with the active_reload
gem. gem active_reload
is not compatible with Rails 3.2 and should be removed. active_reload has been incorporated into Rails 3.2, so it's safe to remove.
I got the solution from here: http://anlek.com/2012/02/user-does-not-respond-to-devise-method/
Completing a tutorial for rails & these answers didn't work for me, but after some searching found a solution. Hope this helps anyone else who's new and running into this issue.
devise_for :installs
(put a hash tag in front)rails generate devise:install
Now Devise should install properly & subsequent errors should be gone.
Source