Search code examples
ruby-on-railsrubyruby-on-rails-4rake

NoMethodError: undefined method `confirm!' for #<User


I am trying to create an app using rails app composer tool. I am using Devise with confirmable. I am getting the error

rake db:seed
rake aborted!
NoMethodError: undefined method `confirm!' for #<User:0xa0b26ec>

during the installation process.

Already the user.rb file has :confirmable

  devise :database_authenticatable, :registerable, :confirmable,
     :recoverable, :rememberable, :trackable, :validatable

I am not able to do rake db:seed.


Solution

  • The #confirm! method has been removed.

    https://github.com/plataformatec/devise/commit/26e22d8e953184b38a87f3a9b935db32258637d5

    You have to use an older version or, what's better switch to the #confirm method.