LoginSignup
14

More than 5 years have passed since last update.

ActiveRecord::PendingMigrationErrorの解決。rails db:migrateを!

Posted at

Rails5でlocalhost:3000にアクセスしたら、ActiveRecord::PendingMigrationErrorが出た。

スクリーンショット 2018-01-07 21.19.48.png
ActiveRecord::PendingMigrationError (

Migrations are pending. To resolve this issue, run:

    bin/rails db:migrate RAILS_ENV=development

):

Migrationをしろと、Pendingをしてくれている

$ rails db:migrate
== 20180105013951 CreateTopics: migrating =====================================
-- create_table(:topics)
-> 0.0232s
== 20180105013951 CreateTopics: migrated (0.0233s) ============================

Rails s でlocalhost:3000にアクセス

Started GET "/" for 127.0.0.1 at 2018-01-07 21:25:30 +0900
(0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
Processing by Rails::WelcomeController#index as HTML
Rendering vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/templates/rails/welcome/index.html.erb
Rendered vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/templates/rails/welcome/index.html.erb (3.2ms)
Completed 200 OK in 22ms (Views: 7.3ms | ActiveRecord: 0.0ms)

スクリーンショット 2018-01-07 21.32.07.png

これでローカル環境でのブラウザ上のエラーは無くなりました。
エラーは好まないけど、エラーメッセージは友達になりたい。

参考にして頂けたら幸いです。
http://www.papa-programing.jp/entry/rails-migration-timestamps

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
14