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 3 years have passed since last update.

Rails Tutorial Gimei で行った変更が反映されなかったときしたこと-memo-

Posted at

ユーザーのサンプルデータを外国人の名前から日本人の名前にしようと思ったとき
seeds.rb からサンプルデータをGimei gem を使って変更したが

rails db:seed

rails aborted!
ActiveRecord::RecordInvalid: Validation failed: Email has already been taken

このようなエラーが出たので

rails db:reset
rails db:seed
rails db:migrate

の順にやったが変わらず

$ rails db:drop
$ rails db:create
$ rails db:schema:load
$ rails db:seed
$ rails db:migrate

でうまくいった。

参考
https://qiita.com/suzuki-koya/items/02d5e349bff179c44454

0
0
1

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?