Undefined local variable or method `unconfirmed_email' when registering users?

Ruby on-RailsRuby on-Rails-3Devise

Ruby on-Rails Problem Overview


I just installed Devise in my app, configured the views and everything. However, when I click the sign up button I get this error:

NameError in Devise::RegistrationsController#create
undefined local variable or method `unconfirmed_email' for #<User:0x00000103721b28>

Why is this? Also, I'm using tlsmail to send emails out through my gmail business account. This might be a problem as well.

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

unconfirmed_email is required for reconfirmable. For some reason this was enabled by default in config/intializers/devise.rb:

config.reconfirmable = true

All you have to do is set this to false.

Solution 2 - Ruby on-Rails

You miss unconfirmed_email column in db.

add t.reconfirmable in migrations and run rake db:migrate

or if you're using devise >= 2.0

t.string   :unconfirmed_email

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionvaratisView Question on Stackoverflow
Solution 1 - Ruby on-RailsvaratisView Answer on Stackoverflow
Solution 2 - Ruby on-RailsFivellView Answer on Stackoverflow