web-dev-qa-db-ja.com

HerokuでWebサイトをホストする際に問題が発生する

私はプログラミングのバックエンドスケールについてさらに学び始めています。

最近、私はHerokuを2回目または3回目に起動しました。今回は実際にMacにGitアップデートをインストールし、Herokuをターミナルにインストールしました。

Sinatra gemを使用して静的なHTMLサイトをアップロードしたかった。ターミナル内ではすべてうまくいきましたが、すべてが機能し、サイトのファイルがHerokuに接続された後にシナトラを追加しました。私のログでは、Sinatra gemが欠落していることがわかりましたので、インストールしました。

私のサイトには、適切なapp.rbファイルとconfig.ruファイルの両方が含まれています。しかし、オンラインでは何も表示されず、空白の画面が表示されます!

この問題についてHerokuに連絡することは非常に困難でした。毎日返事をもらっており、毎日私はまったく役に立たなかった返事に対する質問で答えています。

編集:

Herokuのログファイルは次のとおりです。

2011-05-18T00:25:20+00:00 app[web.1]: 71.198.0.51 - - [17/May/2011 17:25:20] "GET /favicon.ico HTTP/1.1" 404 18 0.0008
2011-05-18T00:25:20+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=2ms bytes=313
2011-05-18T00:25:26+00:00 app[web.1]: 71.198.0.51 - - [17/May/2011 17:25:26] "GET /favicon.ico HTTP/1.1" 404 18 0.0008
2011-05-18T00:25:26+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=5ms bytes=313
2011-05-17T18:25:51-07:00 heroku[web.1]: Idling
2011-05-17T18:26:01-07:00 heroku[web.1]: State changed from up to down
2011-05-18T01:26:01+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-05-18T01:26:01+00:00 app[web.1]: >> Stopping ...
2011-05-18T01:26:02+00:00 heroku[web.1]: Process exited
2011-05-17T20:12:46-07:00 heroku[web.1]: Unidling
2011-05-17T20:12:47-07:00 heroku[web.1]: State changed from created to starting
2011-05-18T03:12:48+00:00 heroku[web.1]: Starting process with command: `thin -p 40055 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-18T03:12:49+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious)
2011-05-18T03:12:49+00:00 app[web.1]: >> Maximum connections set to 1024
2011-05-18T03:12:49+00:00 app[web.1]: >> Listening on 0.0.0.0:40055, CTRL+C to stop
2011-05-18T03:12:50+00:00 heroku[router]: GET pxlc.heroku.com/ dyno=web.1 queue=0 wait=9954ms service=6ms bytes=565
2011-05-18T03:12:50+00:00 app[web.1]: 70.91.206.114 - - [17/May/2011 20:12:50] "GET /style.css HTTP/1.1" 200 - 0.0012
2011-05-18T03:12:50+00:00 heroku[router]: GET pxlc.heroku.com/style.css dyno=web.1 queue=0 wait=0ms service=2ms bytes=269
2011-05-17T20:12:50-07:00 heroku[web.1]: State changed from starting to up
2011-05-18T03:12:51+00:00 app[web.1]: 70.91.206.114 - - [17/May/2011 20:12:51] "GET /favicon.ico HTTP/1.1" 404 18 0.0008
2011-05-18T03:12:51+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms bytes=313
2011-05-18T03:13:05+00:00 heroku[router]: GET pxlc.heroku.com/ dyno=web.1 queue=0 wait=0ms service=5ms bytes=565
2011-05-18T03:13:05+00:00 app[web.1]: 70.91.206.114 - - [17/May/2011 20:13:05] "GET / HTTP/1.1" 200 293 0.0011
2011-05-18T03:13:05+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=2ms bytes=313
2011-05-18T03:13:05+00:00 app[web.1]: 70.91.206.114 - - [17/May/2011 20:13:05] "GET /favicon.ico HTTP/1.1" 404 18 0.0007
2011-05-18T03:57:05+00:00 app[web.1]: 172.18.33.56, 58.96.134.66 - - [17/May/2011 20:57:05] "GET / HTTP/1.1" 200 293 0.0007
2011-05-18T03:57:05+00:00 heroku[router]: GET pxlc.heroku.com/ dyno=web.1 queue=0 wait=0ms service=4ms bytes=565
2011-05-18T03:57:05+00:00 app[web.1]: 172.18.33.56, 58.96.134.66 - - [17/May/2011 20:57:05] "GET /style.css HTTP/1.1" 200 - 0.0007
2011-05-18T03:57:05+00:00 heroku[router]: GET pxlc.heroku.com/style.css dyno=web.1 queue=0 wait=0ms service=2ms bytes=269
2011-05-18T03:57:08+00:00 app[web.1]: 172.18.33.56, 58.96.134.66 - - [17/May/2011 20:57:08] "GET /favicon.ico HTTP/1.1" 404 18 0.0008
2011-05-17T21:58:27-07:00 heroku[web.1]: Idling
2011-05-18T04:58:30+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-05-18T04:58:30+00:00 app[web.1]: >> Stopping ...
2011-05-18T04:58:30+00:00 heroku[web.1]: Process exited
2011-05-17T21:58:33-07:00 heroku[web.1]: State changed from up to down
2011-05-17T23:11:58-07:00 heroku[web.1]: Unidling
2011-05-17T23:11:58-07:00 heroku[web.1]: State changed from created to starting
2011-05-18T06:12:00+00:00 heroku[web.1]: Starting process with command: `thin -p 40091 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-18T06:12:01+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious)
2011-05-18T06:12:01+00:00 app[web.1]: >> Maximum connections set to 1024
2011-05-18T06:12:01+00:00 app[web.1]: >> Listening on 0.0.0.0:40091, CTRL+C to stop
2011-05-18T06:12:01+00:00 app[web.1]: 183.97.156.226 - - [17/May/2011 23:12:01] "GET / HTTP/1.1" 200 293 0.0017
2011-05-18T06:12:02+00:00 heroku[router]: GET pxlc.heroku.com/ dyno=web.1 queue=0 wait=3209ms service=5ms bytes=565
2011-05-18T06:12:03+00:00 app[web.1]: 183.97.156.226 - - [17/May/2011 23:12:03] "GET /style.css HTTP/1.1" 200 - 0.0019
2011-05-17T23:12:08-07:00 heroku[web.1]: State changed from starting to up
2011-05-18T00:13:13-07:00 heroku[web.1]: Idling
2011-05-18T00:13:16-07:00 heroku[web.1]: State changed from up to down
2011-05-18T07:13:16+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-05-18T07:13:16+00:00 app[web.1]: >> Stopping ...
2011-05-18T07:13:17+00:00 heroku[web.1]: Process exited
2011-05-18T01:54:21-07:00 heroku[web.1]: Unidling
2011-05-18T01:54:21-07:00 heroku[web.1]: State changed from created to starting
2011-05-18T08:54:23+00:00 heroku[web.1]: Starting process with command: `thin -p 59491 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-18T08:54:24+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious)
2011-05-18T08:54:24+00:00 app[web.1]: >> Maximum connections set to 1024
2011-05-18T08:54:24+00:00 app[web.1]: >> Listening on 0.0.0.0:59491, CTRL+C to stop
2011-05-18T01:54:28-07:00 heroku[web.1]: State changed from starting to up
2011-05-18T08:54:28+00:00 heroku[router]: GET pxlc.heroku.com/ dyno=web.1 queue=0 wait=6943ms service=6ms bytes=565
2011-05-18T08:54:28+00:00 app[web.1]: 62.244.82.72 - - [18/May/2011 01:54:28] "GET / HTTP/1.1" 200 293 0.0018
2011-05-18T08:54:28+00:00 heroku[router]: GET pxlc.heroku.com/style.css dyno=web.1 queue=0 wait=0ms service=2ms bytes=269
2011-05-18T08:54:28+00:00 app[web.1]: 62.244.82.72 - - [18/May/2011 01:54:28] "GET /style.css HTTP/1.1" 200 - 0.0014
2011-05-18T08:54:28+00:00 app[web.1]: 62.244.82.72 - - [18/May/2011 01:54:28] "GET /favicon.ico HTTP/1.1" 404 18 0.0008
2011-05-18T08:54:28+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=1ms bytes=313
2011-05-18T08:54:28+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms bytes=313
2011-05-18T08:54:28+00:00 app[web.1]: 62.244.82.72 - - [18/May/2011 01:54:28] "GET /favicon.ico HTTP/1.1" 404 18 0.0008
2011-05-18T08:54:28+00:00 app[web.1]: 62.244.82.72 - - [18/May/2011 01:54:28] "GET /favicon.ico HTTP/1.1" 404 18 0.0008
2011-05-18T08:54:28+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=1ms bytes=313
2011-05-18T02:55:23-07:00 heroku[web.1]: Idling
2011-05-18T02:55:33-07:00 heroku[web.1]: State changed from up to down
2011-05-18T09:55:34+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-05-18T09:55:34+00:00 app[web.1]: >> Stopping ...
2011-05-18T09:55:34+00:00 heroku[web.1]: Process exited
2011-05-18T07:23:10-07:00 heroku[web.1]: State changed from created to starting
2011-05-18T14:23:12+00:00 heroku[web.1]: Starting process with command: `thin -p 20560 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-18T14:23:13+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious)
2011-05-18T14:23:13+00:00 app[web.1]: >> Maximum connections set to 1024
2011-05-18T14:23:13+00:00 app[web.1]: >> Listening on 0.0.0.0:20560, CTRL+C to stop
2011-05-18T07:23:13-07:00 heroku[web.1]: State changed from starting to up
2011-05-18T14:23:14+00:00 app[web.1]: 12.183.19.10 - - [18/May/2011 07:23:14] "GET / HTTP/1.1" 200 293 0.0018
2011-05-18T14:23:14+00:00 heroku[router]: GET pxlc.heroku.com/ dyno=web.1 queue=0 wait=0ms service=7ms bytes=565
2011-05-18T14:23:14+00:00 app[web.1]: 12.183.19.10 - - [18/May/2011 07:23:14] "GET /style.css HTTP/1.1" 200 - 0.0015
2011-05-18T14:23:14+00:00 heroku[router]: GET pxlc.heroku.com/style.css dyno=web.1 queue=0 wait=0ms service=2ms bytes=269
2011-05-18T14:23:14+00:00 app[web.1]: 12.183.19.10 - - [18/May/2011 07:23:14] "GET /favicon.ico HTTP/1.1" 404 18 0.0009
2011-05-18T14:23:14+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=2ms bytes=313
2011-05-18T08:24:03-07:00 heroku[web.1]: Idling
2011-05-18T08:24:07-07:00 heroku[web.1]: State changed from up to down
2011-05-18T15:24:07+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-05-18T15:24:07+00:00 app[web.1]: >> Stopping ...
2011-05-18T17:34:27-07:00 heroku[web.1]: Unidling
2011-05-18T17:34:28-07:00 heroku[web.1]: State changed from created to starting
2011-05-19T00:34:29+00:00 heroku[web.1]: Starting process with command: `thin -p 57621 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-18T17:34:31-07:00 heroku[web.1]: State changed from starting to up
2011-05-19T00:34:32+00:00 heroku[router]: GET pxlc.heroku.com/ dyno=web.1 queue=0 wait=0ms service=5ms bytes=565
2011-05-19T00:34:32+00:00 app[web.1]: 97.83.58.74 - - [18/May/2011 17:34:32] "GET / HTTP/1.1" 200 293 0.0016
2011-05-19T00:34:32+00:00 app[web.1]: 97.83.58.74 - - [18/May/2011 17:34:32] "GET /style.css HTTP/1.1" 200 - 0.0011
2011-05-19T00:34:32+00:00 heroku[router]: GET pxlc.heroku.com/style.css dyno=web.1 queue=0 wait=0ms service=2ms bytes=269
2011-05-19T00:34:34+00:00 heroku[router]: GET pxlc.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms bytes=313
2011-05-19T00:34:34+00:00 app[web.1]: 97.83.58.74 - - [18/May/2011 17:34:34] "GET /favicon.ico HTTP/1.1" 404 18 0.0007
2011-05-18T18:35:48-07:00 heroku[web.1]: Idling
2011-05-18T18:35:51-07:00 heroku[web.1]: State changed from up to down
2
Thomas Miller

質問を編集して、Herokuログファイルの内容を含めることができます。

heroku logs -n 500 --app your_app_name

URLは http://pxlc.heroku.com です。wwwがないことに注意してください。次のHTMLファイルを返しています

<!doctype html> 
<html> 
   <head> 
      <title></title> 
      <link type="text/css" rel="stylesheet" href="style.css" /> 
      <script src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.1/mootools-yui-compressed.js" type="text/javascript"></script> 
   </head> 
   <body> 
   </body> 
</html>
1
Steve Wilhelm