LoginSignup
2
6

More than 3 years have passed since last update.

Herokuデプロイ後のエラー

Posted at

Cloud9上では、問題のなかったページ移行の動作ですが、
Herokuにデプロイ後、Heroku上で確認すると以下のエラーメッセージが出てきてしまいます。
(例えば、loginページからログインし、tasks(タスク一覧ページ)に行こうとすると以下のエラーになってしまう。):point_down:
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.

:point_up:行った対処
☆ マイグレーションの再実行
 ① rails db:migrate:reset
 意味 : 一度DBを削除して、作成し直し、もう一度マイグレーションを実行。

 結果 : 一部動作はクリアしたが、まだエラーが生じる。

注: マイグレーションファイルの内容を大幅に変えていたので、Heroku側のデータベースは一旦リセットする。
 ① heroku pg:reset DATABASE
 ②  To proceed, type xxxxxxxxxxxx or re-run this command with --confirm xxxxxxxxxxxx

アプリ名を入力(xxxxxxxxxxxxの箇所)
 ③ heroku run rails db:migrate
 意味 : テーブルを再作成する。

:frowning2:これでも改善できなかったら、、、
 ① heroku restart
 意味 : herokuのサーバも再起動。

これで何とかエラーは消滅しました。
これを解決するのに2日ほどかかりました。
初心者には結構キツイですね、、

 

2
6
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
6