我第一次将我的应用程序推送到heroku并且出现了一个奇怪的错误。我迁移了数据库,一切都在本地工作......但是我收到了这个错误:
2014-03-18T16:28:10.236221+00:00 heroku[router]: at=info method=GET path=/ host=texthub.herokuapp.com request_id=30104931-b263-4352-aa0c-9a81527f8330 fwd="69.181.68.169" dyno=web.1 connect=1ms service=303ms status=500 bytes=1543
2014-03-18T16:28:14.786856+00:00 heroku[web.1]: State changed from up to starting
2014-03-18T16:28:17.735683+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-03-18T16:28:18.364791+00:00 app[web.1]: [2014-03-18 16:28:18] FATAL SignalException: SIGTERM
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:14:in `run'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:84:in `start'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-03-18T16:28:18.364791+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
2014-03-18T16:28:18.365076+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
2014-03-18T16:28:18.365076+00:00 app[web.1]: bin/rails:4:in `require'
2014-03-18T16:28:18.365076+00:00 app[web.1]: bin/rails:4:in `<main>'
2014-03-18T16:28:18.365076+00:00 app[web.1]: [2014-03-18 16:28:18] INFO going to shutdown ...
2014-03-18T16:28:18.365076+00:00 app[web.1]: [2014-03-18 16:28:18] INFO WEBrick::HTTPServer#start done.
2014-03-18T16:28:18.480418+00:00 app[web.1]: => Booting WEBrick
2014-03-18T16:28:18.480418+00:00 app[web.1]: => Rails 4.0.3 application starting in production on http://0.0.0.0:10233
2014-03-18T16:28:18.480418+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-03-18T16:28:18.480418+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-03-18T16:28:18.480418+00:00 app[web.1]: I, [2014-03-18T16:28:09.940548 #2] INFO -- : Started GET "/" for 69.181.68.169 at 2014-03-18 16:28:09 +0000
2014-03-18T16:28:18.480418+00:00 app[web.1]: I, [2014-03-18T16:28:10.030924 #2] INFO -- : Processing by HomeController#index as HTML
2014-03-18T16:28:18.480418+00:00 app[web.1]: I, [2014-03-18T16:28:10.213194 #2] INFO -- : Rendered home/_dashboard.html.haml (18.9ms)
2014-03-18T16:28:18.480418+00:00 app[web.1]: I, [2014-03-18T16:28:10.213439 #2] INFO -- : Rendered home/index.html.haml within layouts/application (21.4ms)
2014-03-18T16:28:18.480418+00:00 app[web.1]: I, [2014-03-18T16:28:10.234172 #2] INFO -- : Rendered shared/_sidebar.html.haml (16.6ms)
2014-03-18T16:28:18.480418+00:00 app[web.1]: I, [2014-03-18T16:28:10.234562 #2] INFO -- : Completed 500 Internal Server Error in 203ms
2014-03-18T16:28:18.480612+00:00 app[web.1]: F, [2014-03-18T16:28:10.235334 #2] FATAL -- :
2014-03-18T16:28:18.480612+00:00 app[web.1]: ActionView::Template::Error (stack level too deep):
2014-03-18T16:28:18.480612+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails.rb:56
2014-03-18T16:28:18.480612+00:00 app[web.1]:
2014-03-18T16:28:18.480612+00:00 app[web.1]:
2014-03-18T16:28:18.480612+00:00 app[web.1]: Exiting
2014-03-18T16:28:18.966391+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 24801 -e production`
2014-03-18T16:28:19.944086+00:00 heroku[web.1]: Process exited with status 143
2014-03-18T16:28:26.164935+00:00 app[web.1]: [2014-03-18 16:28:26] INFO WEBrick 1.3.1
2014-03-18T16:28:26.164935+00:00 app[web.1]: [2014-03-18 16:28:26] INFO ruby 2.0.0 (2014-02-24) [x86_64-linux]
2014-03-18T16:28:26.165843+00:00 app[web.1]: [2014-03-18 16:28:26] INFO WEBrick::HTTPServer#start: pid=2 port=24801
2014-03-18T16:28:28.317348+00:00 heroku[router]: at=info method=GET path=/ host=texthub.herokuapp.com request_id=85437f2d-7b10-47f6-b2aa-f89ec8d7ccde fwd="69.181.68.169" dyno=web.1 connect=3ms service=560ms status=500 bytes=1543
2014-03-18T16:28:26.734041+00:00 heroku[web.1]: State changed from starting to up
这是我在heroku重启时得到的......但不知道出了什么问题。此外,当我重置数据库时,我得到了这个:
2014-03-18T16:33:29.828749+00:00 app[web.1]: F, [2014-03-18T16:33:20.536092 #2] FATAL -- :
2014-03-18T16:33:29.828749+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly
2014-03-18T16:33:29.828749+00:00 app[web.1]: : SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1):
2014-03-18T16:33:29.828749+00:00 app[web.1]: app/controllers/application_controller.rb:13:in `load_customers'
2014-03-18T16:33:29.828749+00:00 app[web.1]:
2014-03-18T16:33:29.828749+00:00 app[web.1]:
2014-03-18T16:33:29.828749+00:00 app[web.1]: Exiting
load_customers是这样的:
def load_customers
@sidebar_customers = current_user.company.customers.open_or_claimed if user_signed_in?
end
但是用户没有登录,因为我没有让我的应用加载一次
编辑:尝试在application.rb中添加:config.assets.initialize_on_precompile = false
还没有运气