我尝试将我的应用部署到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 the
matchmethod in your router without specifying an HTTP method. (RuntimeError)
If you want to expose your action to both GET and POST, add
via: [:get, :post]option.
If you want to expose your action to GET, use
getin 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:in
initialize'
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:in
add_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:in
block 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:in
match'
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:in
instance_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:in
draw'
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:in
load'
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:in
load_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:in
block 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:in
load_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:in
reload_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:in
call'
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:in
block 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:in
run_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:in
instance_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:in
block 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:in
block (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:in
block 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:in
each_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:in
run_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:in
method_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:in
require'
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:in
load_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:in
require_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:in
require'
from script/rails:6:in `'.
normalize_conditions!': You should not use the
答案 0 :(得分:0)
您的环境配置文件(development.rb
,production.rb
&amp; test.rb
)可能已损坏。
如果你发布那些我们可以看到确切问题是什么,同时 - 这里是config.eager_load
的有效配置示例:
config.eager_load = true
config.eager_load = false
config.eager_load = false