I've just added a fresh install of devise to a rails app but it's outputtin a warning on start server start and devise is not working at all:
[WARNING] You provided devise_for :users but there is no model User defined in your application
I 100% do have a model called users.
I've had a look about at others with this issue there is this one (Heroku [WARNING] You provided devise_for :users but there is no model User defined in your application) and I've changed the name of ':database_authenticable'. This did not fix it.
Also the devise initializer is set to active record, which is another bug which has this error (require 'devise/orm/active_record'), however this did not fix it either.
Has anyone else has this error, or is there a way I can trace it to get more details? Thanks.
I think if you have devise_for :users in your routes it will target your user model (singular). You said the name of your model is users, which could make it not work.
Check the model is in app/models/user.rb
, not users.rb
, and run ruby -c app/models/user.rb
to do a syntax check.
If User exists and doesn't have a syntax error, it may be failing to load because it's trying to include something that doesn't exist. Comment out the body of the class and see if Devise lets you run rails console
now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With