试图将Rails应用程序部署到Heroku - 应用程序错误?

时间:2014-03-23 21:14:12

标签: ruby-on-rails heroku

我不确定为什么会这样。我按照另一个SO线程的建议尝试了heroku restart并运行herok run rake db:migrate,但它没有用。

为了澄清一下,我的应用程序在localhost上工作正常。

HEROKU日志:

2014-03-23T21:07:47.989154+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
2014-03-23T21:07:47.989154+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
2014-03-23T21:07:47.989709+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:48:in `app'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-03-23T21:07:47.989709+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
2014-03-23T21:07:47.989709+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-03-23T21:07:47.989883+00:00 app[web.1]:    from bin/rails:4:in `require'
2014-03-23T21:07:47.990048+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2014-03-23T21:07:49.415499+00:00 heroku[web.1]: Process exited with status 1
2014-03-23T21:07:49.431611+00:00 heroku[web.1]: State changed from starting to crashed
2014-03-23T21:07:49.431611+00:00 heroku[web.1]: State changed from crashed to starting
2014-03-23T21:07:54.457611+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 51763 -e production`
2014-03-23T21:08:04.929404+00:00 app[web.1]: => Booting WEBrick
2014-03-23T21:08:04.929404+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-03-23T21:08:04.934429+00:00 app[web.1]: 
2014-03-23T21:08:04.929404+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-03-23T21:08:04.929404+00:00 app[web.1]: Exiting
2014-03-23T21:08:04.934429+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.3/lib/devise/rails/routes.rb:481:in `raise_no_secret_key': Devise.secret_key was not set. Please add the following to your Devise initializer: (RuntimeError)
2014-03-23T21:08:04.934429+00:00 app[web.1]: 
2014-03-23T21:08:04.934429+00:00 app[web.1]:   config.secret_key = '0964de5caa044bc2ff80ae8c6a0f635d8088b348014048dd7a822e5156b4abb76e6a67d2ad2b3a77ec34221815146e3ce8c09822ec3058af44f6c85ae53073e0'
2014-03-23T21:08:04.934429+00:00 app[web.1]: Please ensure you restarted your application after installing Devise or setting the key.
2014-03-23T21:08:04.929404+00:00 app[web.1]: => Rails 4.0.3 application starting in production on http://0.0.0.0:51763
2014-03-23T21:08:04.934429+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:341:in `instance_exec'
2014-03-23T21:08:04.934429+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:341:in `eval_block'
2014-03-23T21:08:04.934429+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:319:in `draw'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/config/routes.rb:1:in `<top (required)>'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:223:in `load'
2014-03-23T21:08:04.934429+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.3/lib/devise/rails/routes.rb:206:in `devise_for'
2014-03-23T21:08:04.934429+00:00 app[web.1]:    from /app/config/routes.rb:2:in `block in <top (required)>'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:40:in `each'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:40:in `load_paths'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:16:in `reload!'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application.rb:102:in `reload_routes!'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.3/lib/devise/rails.rb:14:in `block in <class:Engine>'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:223:in `load'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:44:in `each'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application/finisher.rb:55:in `block in <module:Finisher>'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `instance_exec'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:54:in `run_initializers'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:55:in `block in run_initializers'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/config.ru:3:in `block in <main>'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `block in require'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:48:in `app'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:75:in `start'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-03-23T21:08:04.934783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:223:in `block in load'
2014-03-23T21:08:04.938108+00:00 app[web.1]:    from bin/rails:4:in `require'
2014-03-23T21:08:04.938108+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
2014-03-23T21:08:04.938108+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:36:in `call'
2014-03-23T21:08:04.935072+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `run'
2014-03-23T21:08:04.935788+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application.rb:215:in `initialize!'
2014-03-23T21:08:04.936062+00:00 app[web.1]:    from /app/config.ru:in `new'
2014-03-23T21:08:04.937179+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-03-23T21:08:06.548407+00:00 heroku[web.1]: Process exited with status 1
2014-03-23T21:08:06.574231+00:00 heroku[web.1]: State changed from starting to crashed
2014-03-23T21:08:07.873844+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=sixtasks.herokuapp.com request_id=7318cb7f-49d1-4d8a-bafd-e269821ce1bc fwd="173.35.60.133" dyno= connect= service= status=503 bytes=
2014-03-23T21:08:08.324562+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=sixtasks.herokuapp.com request_id=f03ca9a7-b3a8-4c7e-b7d5-cd3d7b7a280e fwd="173.35.60.133" dyno= connect= service= status=503 bytes=
2014-03-23T21:08:13.353853+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=sixtasks.herokuapp.com request_id=99ccb00a-d386-402d-8266-4b0e4dc39bc1 fwd="173.35.60.133" dyno= connect= service= status=503 bytes=
2014-03-23T21:08:11.632076+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=sixtasks.herokuapp.com request_id=0e9f41d3-f213-4a26-9008-d8a5fad2d78a fwd="173.35.60.133" dyno= connect= service= status=503 bytes=
2014-03-23T21:08:11.885694+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=sixtasks.herokuapp.com request_id=283244bb-5cde-4c39-8835-6b17cb031725 fwd="173.35.60.133" dyno= connect= service= status=503 bytes=
2014-03-23T21:08:13.179142+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=sixtasks.herokuapp.com request_id=3ea65bb3-7620-497c-a006-d70eacddf0d8 fwd="173.35.60.133" dyno= connect= service= status=503 bytes=
2014-03-23T21:13:46+00:00 heroku[slug-compiler]: Slug compilation started
2014-03-23T21:14:19+00:00 heroku[slug-compiler]: Slug compilation finished
2014-03-23T21:14:19.669604+00:00 heroku[web.1]: State changed from crashed to starting
2014-03-23T21:14:19.480299+00:00 heroku[api]: Deploy e4f2c99 by andrew@gmail.com
2014-03-23T21:14:19.480401+00:00 heroku[api]: Release v8 created by andrew.louis93@gmail.com
2014-03-23T21:14:24.461087+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 22691 -e production`

1 个答案:

答案 0 :(得分:0)

我认为这部分是相关部分。

2014-03-23T21:08:04.934429+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/devise- 3.2.3/lib/devise/rails/routes.rb:481:in `raise_no_secret_key': Devise.secret_key was not set. Please add the following to your Devise initializer: (RuntimeError)
2014-03-23T21:08:04.934429+00:00 app[web.1]:   config.secret_key = '0964de5caa044bc2ff80ae8c6a0f635d8088b348014048dd7a822e5156b4abb76e6a67d2ad2b3a77ec34221815146e3ce8c09822ec3058af44f6c85ae53073e0'
2014-03-23T21:08:04.934429+00:00 app[web.1]: Please ensure you restarted your application after installing Devise or setting the key.

好像您已在本地主机中设置了密钥,但未在您的heroku客户端上设置。你可以发布你的设计配置文件吗?如果您使用

设置密钥
ENV['secret_key']

或你需要做的事

heroku config:set secret_key=YOUR SECRET KEY HERE

让你的heroku应用程序访问它。如果您有任何疑问,请发表评论!

[Edit1]在config / initializers / devise.rb中添加以下行

config.secret_key ='0964de5caa044bc2ff80ae8c6a0f635d8088b348014048dd7a822e5156b4abb76e6a67d2ad2b3a77ec34221815146e3ce8c09822ec3058af44f6c85ae53073e0'

相关问题