0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Undefined method `password_digest'の解決方法

Last updated at Posted at 2020-05-19

Undefined method password_digest

単なるスペルミスによるエラーだった。エラー文には

undefined method `password_digest='
       Did you mean?  password__digest=
                      password__digest
                      password__digest?

とあった。password__の_が全角になっていたので直す。

そしてデータベースを変更してRspecをしてOKかと思われたが..

引き続きエラー。エラー文も変わらない。

これはテスト用のデータベースが変わっていない為。なので、

rails db:migrate RAILS_ENV=test VERSION=0

このコマンドを打つことでテスト用にマイグレーションファイルをいちからマイグレートする。

そしてRspecして通ればOK。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?