0

我刚刚创建了一个简单的 rails 应用程序并将其推送到 heroku。在我的系统中,它工作正常。但是在 Heroku 中,如果我访问主页,我会收到错误消息“我们很抱歉,但出了点问题。”。这是我的heroku日志...我该如何解决?

    2012-09-11T12:12:03+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
    2012-09-11T12:12:03+00:00 app[web.1]: 
    2012-09-11T12:12:03+00:00 heroku[router]: GET evening-tor-7280.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=556ms status=500 bytes=643
    2012-09-11T12:12:04+00:00 heroku[router]: GET evening-tor-7280.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=12ms status=200 bytes=0
    2012-09-11T12:28:55+00:00 app[web.1]: 
    2012-09-11T12:28:55+00:00 app[web.1]: 
    2012-09-11T12:28:55+00:00 app[web.1]: Started GET "/" for 113.59.222.3 at 2012-09-11 12:28:55 +0000
    2012-09-11T12:28:55+00:00 app[web.1]: 
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection'
    2012-09-11T12:28:55+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:170:in `retrieve_connection'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:144:in `connection'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:67:in `rescue in call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:61:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__512560152559991210__call__407393761818664548__callbacks'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/log_tailer.rb:17:in `call'
    2012-09-11T12:28:55+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
    2012-09-11T12:28:55+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    2012-09-11T12:28:55+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
    2012-09-11T12:28:55+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    2012-09-11T12:28:55+00:00 app[web.1]: 
    2012-09-11T12:28:55+00:00 app[web.1]: 
    2012-09-11T12:28:55+00:00 heroku[router]: GET evening-tor-7280.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=7ms status=500 bytes=643
    2012-09-11T12:28:55+00:00 heroku[router]: GET evening-tor-7280.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=6ms status=304 bytes=0
    2012-09-11T12:36:13+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by pubudu.th@gmail.com
    2012-09-11T12:36:16+00:00 heroku[run.1]: Awaiting client
    2012-09-11T12:36:16+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:migrate`
    2012-09-11T12:36:16+00:00 heroku[run.1]: State changed from starting to up
    2012-09-11T12:36:22+00:00 heroku[run.1]: Client connection closed. Sending SIGHUP to all processes
    2012-09-11T12:36:23+00:00 heroku[run.1]: Process exited with status 1
    2012-09-11T12:36:23+00:00 heroku[run.1]: State changed from up to complete
    2012-09-11T12:36:34+00:00 app[web.1]: 
    2012-09-11T12:36:34+00:00 app[web.1]: 
    2012-09-11T12:36:34+00:00 app[web.1]: Started GET "/" for 113.59.222.3 at 2012-09-11 12:36:34 +0000
    2012-09-11T12:36:34+00:00 app[web.1]: 
    2012-09-11T12:36:34+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:170:in `retrieve_connection'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:61:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:67:in `rescue in call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:144:in `connection'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__512560152559991210__call__407393761818664548__callbacks'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/log_tailer.rb:17:in `call'
    2012-09-11T12:36:34+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
    2012-09-11T12:36:34+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    2012-09-11T12:36:34+00:00 app[web.1]: 
    2012-09-11T12:36:34+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    2012-09-11T12:36:34+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
    2012-09-11T12:36:34+00:00 app[web.1]: 
    2012-09-11T12:36:34+00:00 heroku[router]: GET evening-tor-7280.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=8ms status=500 bytes=643
    2012-09-11T12:36:34+00:00 heroku[router]: GET evening-tor-7280.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=38ms status=304 bytes=0
4

1 回答 1

2

您的应用程序正在寻找连接到数据库,请查看ActiveRecord::ConnectionNotEstablished您的日志。

将提供和pg之间连接的 gem添加到您的 gemfile 中,Heroku 应该会自动连接。ARpostgres

于 2012-09-11T23:24:59.817 回答