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 db:migrateするとStandardError: An error has occurred, all later migrations canceled:のエラーコード発生

Last updated at Posted at 2021-02-20

###①内容
####deviseをinstallした後のrails db:migrateをしたところStandardError: An error has occurred, all later migrations canceled:のエラーコード発生。

###②結論
####config/database.ymlのencoding: utf8mb4 ⇒ utf8にした事で解消。

###③詳細
①ログイン機能実施の為、deviseのinstall実行
         
②rails g devise user(userモデルを作成)
         
③rails db:migrate(マイグレーションの実行)
         
④rails db:migrate:statusで確認すると、、、

 Status   Migration ID    Migration Name
--------------------------------------------------
  down    20210215130947  Devise create users

◉ここでUPになっていないことに気付く。

⑤rails db:migrate:resetもNG

⑥調査しconfig/database.ymlのencoding: utf8mb4 ⇒ utf8にした事で解消。

⑦その後rails db:migrate:reset ⇒ rails db:migrateの順でターミナル実行

⑧rails db:migrate:status

 Status   Migration ID    Migration Name
--------------------------------------------------
   up     20210215130947  Devise create users

こちらで解消。

今回も勉強になりました!!

初心者ですが、解消方法などを載せていきます。

間違い等ございましたら、ご指導ご鞭撻の程、よろしくお願いします。

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?