LoginSignup
2
0

More than 3 years have passed since last update.

ridgepoleを導入してMigrations are pendingエラー

Posted at

はじめに

先日、RSpecを実行するとこのようなエラーが出ました。

Migrations are pending. To resolve this issue, run:
        rails db:migrate RAILS_ENV=test
No examples found.

マイグレートしろと言われている。。。
ridgepoleを使っているのに。。。

試したこと

  • schemafileに間違いがないか確認
  • ridgepoleコマンドを再度実行
  • DBを消して、再度作成する

これらを実施しても治りませんでした。

原因&解決方法

原因を探っていると、migrationファイルを発見しました。

rails g model --skip-migration

を忘れていた!!!

このmigrationファイルを消してRSpecを実行してみると、今度はちゃんと動きました。

教訓

  • ridgepoleを使う時は--skip-migrationを忘れない
  • こまめにコミットしたりテストを動かしたりしてエラーがないか確認する
2
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
2
0