Masahiro Okubo

StandardError: An error has occurred, this and all later migrations canceled: undefined method `shop_id’ for

StandardError: An error has occurred, this and all later migrations canceled:  undefined method `shop_id’ for

新たにカラムを追加する際、

StandardError: An error has occurred, this and all later migrations canceled:

undefined method `shop_id' for ....

というエラーが出てきました

migration ファイルの中で以下のようにインスタンスを作っていたことが原因でした

Something.create()

参考にした記事
[db:migrate] error on migration – undefined method `file_changed?’ #195
Rake aborted. Migrate aborted. Standard Error. Undefined Method. So what exactly causes this?
rake db:migrate fails when using this gem with mysql #31
Problems with migration, “undefined method `ext’” in Active Record?


関連記事

copyright© 2016-2021 Masahiro Okubo