【Rails】ActiveRecord::PendingMigrationErrorの対処

Ruby on Rails

エラーメッセージの
“Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development”

“マイグレーションが保留になっています。解決にはbin/rails db:migrate RAILS_ENV=developmentを実行してください。”
ということなので、書いてある通りに

$ db:migrate

を実行してエラーは解消。

$ rails generate migration xxxx

を実行した後にデータベースへの適用rails db:migrateをし忘れていただけのようでした。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

This site uses Akismet to reduce spam. Learn how your comment data is processed.