我正在尝试使用rails app composer工具创建应用。我正在使用Devise
confirmable
。我收到错误
rake db:seed
rake aborted!
NoMethodError: undefined method `confirm!' for #<User:0xa0b26ec>
在安装过程中。
user.rb
文件已有:confirmable
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable
我无法rake db:seed
。
答案 0 :(得分:12)
#confirm!
方法已被删除。
https://github.com/plataformatec/devise/commit/26e22d8e953184b38a87f3a9b935db32258637d5
您必须使用旧版本,或者更好地切换到#confirm
方法。
答案 1 :(得分:6)
Devise 4.2.0
已强制 confirm!
方法,您必须使用confirm
代替。
4.2.0 - 2016-07-01
删除: -
Remove the deprecated Devise::ParameterSanitizer API from Devise 3. Please use the #permit and #sanitize methods over #for.
Remove the deprecated OmniAuth URL helpers. Use the fully qualified helpers (user_facebook_omniauth_authorize_path) over the scope based helpers ( user_omniauth_authorize_path(:facebook)).
Remove the Devise.bcrypt method, use Devise::Encryptor.digest instead.
Remove the Devise::Models::Confirmable#confirm! method, use confirm instead.
Remove the Devise::Models::Recoverable#reset_password! method, use reset_password instead.
Remove the Devise::Models::Recoverable#after_password_reset method.
从此,
<强> Remove the Devise::Models::Confirmable#confirm! method, use confirm instead.
强>