undefined local variable or method `confirmed_at' for Devise

4.3k Views Asked by At

I am pretty new to RoR and I have installed Devise gem successfully. When i attempt to go t localhost:3000 I receive and error undefined local variable or method `confirmed_at' I am assuming this has to do with the Devise gem. My schema.rb doesnt show the

t.string   "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string   "unconfirmed_email"

I have the Confirmable section non-commented in the Database, as well as added :confirmable in the User.rb file Any help is greatly appreciated here. I'm not sure how to get the schema to match up.

2

There are 2 best solutions below

0
On

I had the exact same problem and I solve it with this steps:

  1. I Close the server

  2. I open my project with command line, then I run these commands

    rake db:migrate:reset
    rake db:reset
  1. I open the project in VS Code then I run

        rails s
    
  2. It works

1
On

THANKS TO ALL THAT HELPED I was able to fix the problem by resetting the db using the following commands rake db:migrate:reset rake db:reset and it reset it all for me. Thanks to all!