2013-02-15 156 views
0

當我試圖訪問一個最近發佈在Heroku上的Rails應用程序,它給了我下面的錯誤:Heroku的Rails應用程序顯示「應用程序錯誤」

Application Error 
An error occurred in the application and your page could not be served. Please try again in a few moments. 

If you are the application owner, check your logs for details. 

當我檢查「Heroku的日誌」我看到以下內容:

2013-02-15T18:56:06+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=olivetalk.org fwd=76.168.74.9 dyno= queue= wait= connect= service= status=503 bytes= 
2013-02-15T18:56:07+00:00 heroku[run.3278]: Client connection closed. Sending SIGHUP to all processes 
2013-02-15T18:56:08+00:00 heroku[run.3278]: Process exited with status 0 
2013-02-15T18:56:08+00:00 heroku[run.3278]: State changed from up to complete 
2013-02-15T18:56:15+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=olivetalk.org fwd=76.168.74.9 dyno= queue= wait= connect= service= status=503 bytes= 
2013-02-15T18:56:17+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=olivetalk.org fwd=76.168.74.9 dyno= queue= wait= connect= service= status=503 bytes= 

我找不出什麼可能是錯的。有什麼建議?

UPDATE:下面是從loggly插件錯誤:

2013-02-15T19:50:43.659Z,default,54.234.29.222,115 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/config.ru:in `new' 
2013-02-15T19:50:43.659Z,default,54.234.29.222,176 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize' 
2013-02-15T19:50:43.659Z,default,54.234.29.222,179 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval' 
2013-02-15T19:50:43.659Z,default,54.234.29.222,129 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/config.ru:3:in `block in <main>' 
2013-02-15T19:50:43.659Z,default,54.234.29.222,198 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require' 
2013-02-15T19:50:43.66Z,default,54.234.29.222,177 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - - from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app' 
2013-02-15T19:50:43.66Z,default,54.234.29.222,182 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - - from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands/server.rb:46:in `app' 
2013-02-15T19:50:43.66Z,default,54.234.29.222,169 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - - from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/server.rb:200:in `app' 
2013-02-15T19:50:43.66Z,default,54.234.29.222,176 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - - from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file' 
2013-02-15T19:50:43.66Z,default,54.234.29.222,170 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - - from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval' 
2013-02-15T19:50:43.66Z,default,54.234.29.222,118 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - - from /app/config.ru:in `<main>' 
2013-02-15T19:50:43.661Z,default,54.234.29.222,188 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `<top (required)>' 
2013-02-15T19:50:43.661Z,default,54.234.29.222,175 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap' 
2013-02-15T19:50:43.661Z,default,54.234.29.222,197 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:55:in `block in <top (required)>' 
2013-02-15T19:50:43.661Z,default,54.234.29.222,184 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands/server.rb:70:in `start' 
2013-02-15T19:50:43.661Z,default,54.234.29.222,171 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/server.rb:254:in `start' 
2013-02-15T19:50:43.662Z,default,54.234.29.222,118 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from script/rails:6:in `<main>' 
2013-02-15T19:50:43.662Z,default,54.234.29.222,119 <13>1 2013-02-15T19:50:43+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 app web.1 - -  from script/rails:6:in `require' 
2013-02-15T19:50:44.749Z,default,50.17.90.179,127 <40>1 2013-02-15T19:50:44+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 heroku web.1 - - State changed from starting to crashed 
2013-02-15T19:50:44.924Z,default,54.234.29.222,117 <40>1 2013-02-15T19:50:44+00:00 d.26e71b30-db64-4275-b420-db8e0213d871 heroku web.1 - - Process exited with status 1 
+1

H10只是意味着你的應用崩潰了,日誌中應該有其他指標。 – catsby 2013-02-15 19:18:47

+0

您是否已將loggly或logentries插件添加到您的應用程序中?他們會給你提供比heroku日誌命令更多的信息。 – Sean 2013-02-15 19:28:58

+0

感謝您的提示。我安裝了loggly並在上面發佈了loggly日誌。我仍然不明白什麼是錯誤的。任何想法? – 2013-02-15 19:53:42

回答

1

您所添加的 'PG' 寶石到您的Gemfile(或正確地配置您的database.yml)?如果數據庫設置不正確,Heroku應用程序將崩潰。

+0

我創建了數據庫並輸入了所有憑證。無論如何只是檢查數據庫連接?非常感謝 – 2013-02-15 20:42:50