質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Sinatra

Sinatraは、Rubyで作られた オープンソースのWebアプリケーションフレームワークです。

Q&A

0回答

665閲覧

herokuでsinatraアプリ開けない(Application error)

nakatievent

総合スコア38

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Sinatra

Sinatraは、Rubyで作られた オープンソースのWebアプリケーションフレームワークです。

0グッド

0クリップ

投稿2020/12/13 14:36

編集2022/01/12 10:55

質問お願いします。
herokusinatraアプリをpushしたのですが、開こうとするとApplication errorが出て開くことができません。

そこで、Application errorに出ているheroku logs --tailを見てみると、

app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' heroku[web.1]: Process exited with status 1 heroku[web.1]: State changed from starting to crashed heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=c2c9d289-4b92-458c-9a1e-22d6bfc754eb fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=064e4d9d-86c1-4421-9572-3c6cee5aee8e fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=ea7c28c8-7414-46c1-a11e-ad6a6d4ec3b4 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=284a89e0-0479-432c-9d11-05926a7b8c79 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https app[api]: Starting process with command `bundle exec rake db:migrate` by user nakatievent@gmail.com heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=fcbcd852-dd8d-4977-9862-678d899e08fd fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=81acd7a1-b933-4205-b61a-544219f2d25f fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=8167a538-a3e2-4af2-9146-bd19137bf805 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=a76b0c64-00f1-44ee-89a3-3148572d5fcd fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=802eb66d-dae2-4471-833e-d010d29609fe fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=96b00769-d761-4cea-8dce-283136375059 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=ffbd1724-0452-4f96-b1ea-410162c60583 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=a90983aa-6655-4871-a32c-5d84da53c4c3 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `new' app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=2f8624e2-f274-4be3-81d2-2b44740f67b5 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=a48495fc-e4fc-4078-9380-a0b2b9b5e16b fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=58e9977e-b5bf-4eff-b8ec-b8accd9e6158 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=c3129734-5c54-4f89-b7b2-84494d6b0099 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=2b7500b7-bdb3-49e8-9d6f-653e26a7d5d8 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=e342ae3f-1288-413f-b671-3638b9669f85 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[web.1]: State changed from crashed to starting heroku[web.1]: Starting process with command `bundle exec ruby app.rb` app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) app[web.1]: Is the server running on host "localhost" (127.0.0.1) and accepting app[web.1]: TCP/IP connections on port 5432? app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `new' app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) app[web.1]: Is the server running on host "localhost" (127.0.0.1) and accepting app[web.1]: TCP/IP connections on port 5432? app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `new' app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' heroku[web.1]: Process exited with status 1 heroku[web.1]: State changed from starting to crashed heroku[web.1]: State changed from crashed to starting heroku[web.1]: Starting process with command `bundle exec ruby app.rb` app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) app[web.1]: Is the server running on host "localhost" (127.0.0.1) and accepting app[web.1]: TCP/IP connections on port 5432? app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `new' app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' heroku[web.1]: Process exited with status 1 heroku[web.1]: State changed from starting to crashed heroku[web.1]: State changed from crashed to starting heroku[web.1]: Starting process with command `bundle exec ruby app.rb` app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) app[web.1]: Is the server running on host "localhost" (127.0.0.1) and accepting app[web.1]: TCP/IP connections on port 5432? app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `new' app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' heroku[web.1]: Starting process with command `bundle exec ruby app.rb` app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) app[web.1]: Is the server running on host "localhost" (127.0.0.1) and accepting app[web.1]: TCP/IP connections on port 5432? app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `new' app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) app[web.1]: Is the server running on host "localhost" (127.0.0.1) and accepting app[web.1]: TCP/IP connections on port 5432? app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `new' app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect' app[web.1]: from app.rb:22:in `<main>' heroku[web.1]: Process exited with status 1 heroku[web.1]: State changed from starting to crashed heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-spire-74335.herokuapp.com request_id=c9d50a37-9234-4e1c-9cb8-888b1d561223 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-spire-74335.herokuapp.com request_id=428fc9ac-1d1f-4608-9b3e-e92e39609f26 fwd="153.131.160.60" dyno= connect= service= status=503 bytes= protocol=https

というエラーが出たのですが、正直何が原因かよく分かりません。
エラーの原因分かる方ご教授お願いします????

*エラー文を全部載せたかったのですが、文字数制限があったため一部しか載せていないです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

FKM

2020/12/14 01:01

最終行あたりに根本的なエラー原因が出力されていませんか?それを貼り付けてください。これだと、処理を終了しましたよという結果しかわかりませんので。
CHERRY

2020/12/14 02:40

PostgreSQL に接続する際にエラーが出ているようですが、接続できますか?
nakatievent

2020/12/14 13:52 編集

できるだけ出力されたエラーを残すようにしましたが、文字数制限があるため少しだけ消去しました。 開発環境ではPostgreSQLに接続できました。 エラーの原因はPostgreSQLに接続できないからですかね?
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問