getting error from devise User does not respond to 'devise' method when running rails generate devise:install
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.
User does not respond to 'devise' method
check this question
getting error from devise "User does not respond to 'devise' method" when running "rails generate devise:install"
1st answer will probably solve your problem.
I ran rails generate devise MODEL before rails generate devise:install
You can undo generation commands with rails destroy ...
, so in your case it would be:
$ rails destroy devise MODEL
If that doesn't work for whatever reason, you can just delete the model and migration - they're only files.
Installing Devise: `PG::UndefinedTable: ERROR: relation users does not exist`
Did you have a User
model before? It seems that devise thought that too and it's trying to add its columns to a non-existent User
model.
This is what I would do...
- Run
rails db:drop
- Delete
db/schema.rb
file. - Delete
db/migrate/20190915133638_add_devise_to_users.rb
- Run
rails generate devise:install
again - Run
rails db:migrate
EDIT
If the previous steps didn't work then try to create a users
table before devise's migration.
For this follow these steps:
rails g model User
- Change the name of the migration file so it will be executed right before the
AddDeviseToUsers
migration. - Run
rails db:migrate
Related Topics
How to Create a Rails 3 Route That Will Match All Requests and Direct to One Resource/Page
Restrict File Upload to Some File Extensions
"No Available Formula for Gcc46" While Installing Ruby 1.9.3 on Os X with Rvm:
I Can't Remove Whitespaces from a String Parsed by Nokogiri
Static Site Generator Based Upon Directories & Files
Result.Credit_Card_Verification Is Returning Nil Even on Error in Braintree
Rails 3:Do I Need to Give Return True in a Before_Save Callback for an Object.Save to Work
Why Is Ruby Throwing a Segmentation Fault on Only My System, and Only in This Rails Application
How Write into CSV File Properly
"The Ruby Way" (Mixins and Class Reopening) VS. Dependency Injection
Dynamically Get Object's Attribute
Gem And/Or Ruby on Rails Broke All of a Sudden, Anyone Know What Happened
What's the Efficient Way to Multiply Two Arrays and Get Sum of Multiplied Values in Ruby
Is There an Easy-To-Use Ftp Library for Ruby
Normal Variables VS Instance Variable in Ruby, Whats the Difference