2016-08-01 15 views
2

rails app composerツールを使用してアプリを作成しようとしています。私はDeviseconfirmableを使用しています。このエラーが表示されるNoMethodError:未定義のメソッド `confirm! ' for#<

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

インストール中にエラーが表示されます。

すでにuser.rbファイルは、私がrake db:seedを行うことができないのです:confirmable

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

を持っています。

+0

あなたが使っているDEVISEのバージョンは何ですか? – Sravan

答えて

6

Devise 4.2.0confirm!方法はを廃止予定している、あなたの代わりに使用confirmに持っています。

4.2.0 - 2016年7月1日

削除: - このことから

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.

Here is the refference

+0

それは働いた。ありがとうございました。 –

+0

あなたが正しい方法であなたを助けたら私の答えを受け入れることができますか?あなたがしたい場合。 – Sravan

関連する問題