NoMethodError: undefined method `current_sign_in_at' for #User:0x000055ce01dcf0a8 by using Devise_token_auth rails gem is not working
I had this issue recently and it turns out I didn't have the trackable fields in my migration. There are two ways to fix this:
Option one. Add a new migration that adds the trackable fields to User
## Trackable
t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.inet :current_sign_in_ip
t.inet :last_sign_in_ip
Run rake db:migrate
The second option: run a down migration
Start with this command - add your migration version number
rake db:migrate:down VERSION=xxxxxxxxxxxxxx
You should then be able to add the trackable fields to the migration file and then run
rake db:migrate up VERSION=xxxxxxxxxxxxxx
Run rake db:migrate