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.

[エラーメッセージ]”ActiveRecord::PendingMigrationError”解決までの流れ

0
Posted at

1.前提条件

開発環境

Ruby:ruby 3.1.2
Rails:Rails 6.1.6.1
OS:Windows11 Home

2.エラーメッセージの内容

error_img

②エラーメッセージ翻訳

エラーメッセージを翻訳する
 
 ”移行は保留中です。 この問題を解決するには、次を実行します。
  bin/rails db: RAILS_ENV=development を移行
  保留中の移行が 1 件あります:
  20210727061455_create_books.rb”

③エラーの原因を考える (※考えられる原因は随時追記することとする。)

今回のエラーはmigrateし忘れているというものである。
考えられる理由を下記に記述する。

 ・単純にrails db:migrateし忘れている

3.エラーの解決方法

①ターミナルにマイグレーション実行の下記のコマンドを打ち込む

$ rails db:migrate

②ブラウザにて、エラーが解除されていることを確認する

 ※解除されていない場合、ほかの原因を探る

4.参考サイト

(railsガイド): https://railsguides.jp/active_record_migrations.html

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?