在Rails 4.0上使用Unicorn在“/”处部署到Heroku 504错误

时间:2015-01-29 19:15:27

标签: ruby-on-rails ruby heroku unicorn

我尝试将我的应用部署到heroku但遇到504错误,以及一个应用页面(vipp.heroku.com),其中显示"应用程序错误"。我的rails控制台如下所示:

config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  • development - set it to false
  • test - set it to false (unless you use a tool that preloads your test environment)
  • production - set it to true

/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:191:in normalize_conditions!': You should not use thematchmethod in your router without specifying an HTTP method. (RuntimeError) If you want to expose your action to both GET and POST, addvia: [:get, :post]option. If you want to expose your action to GET, usegetin the router: Instead of: match "controller#action" Do: get "controller#action" from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:67:ininitialize' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1438:in new' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1438:inadd_route' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1417:in decomposed_match' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1398:inblock in match' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1389:in each' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1389:inmatch' from /app/config/routes.rb:16:in block in <top (required)>' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:ininstance_exec' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in eval_block' from /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:294:indraw' from /app/config/routes.rb:1:in <top (required)>' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:inload' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in block in load' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:inload_dependency' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in load' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:inblock in load_paths' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in each' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:inload_paths' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in reload!' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:102:inreload_routes!' from /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.0/lib/devise/rails.rb:14:in block in <class:Engine>' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:36:incall' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:36:in execute_hook' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:45:inblock in run_load_hooks' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:44:in each' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:44:inrun_load_hooks' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:55:in block in <module:Finisher>' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:ininstance_exec' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in run' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:inblock in run_initializers' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in block in tsort_each' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:inblock (2 levels) in each_strongly_connected_component' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in each_strongly_connected_component_from' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:inblock in each_strongly_connected_component' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in each' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:ineach_strongly_connected_component' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in tsort_each' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:inrun_initializers' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in initialize!' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:inmethod_missing' from /app/config/environment.rb:5:in <top (required)>' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:inrequire' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in block in require' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:inload_dependency' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in require' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:inrequire_environment!' from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:63:in <top (required)>' from script/rails:6:inrequire' from script/rails:6:in `'.

normalize_conditions!': You should not use the

1 个答案:

答案 0 :(得分:0)

您的环境配置文件(development.rbproduction.rb&amp; test.rb)可能已损坏。 如果你发布那些我们可以看到确切问题是什么,同时 - 这里是config.eager_load的有效配置示例:

production.rb

config.eager_load = true

development.rb

config.eager_load = false

test.rb

config.eager_load = false