Rails ActionView :: Template ::生产错误

时间:2013-12-20 18:21:03

标签: ruby-on-rails

我有一个正在开发的Rails 4应用程序,但是当我使用Capistrano部署到VPS时,我收到以下错误:

INFO -- : Started GET "/" for ***.***.***.*** at 2013-12-20 22:24:28 +0000
INFO -- : Processing by PortalsController#index as HTML
INFO -- :   Rendered portals/index.haml within layouts/application (2.9ms)
INFO -- : Completed 500 Internal Server Error in 7ms
FATAL -- : 
ActionView::Template::Error (key not found: :params):
    1: %h2
    2:   = link_to "New portal", new_portal_path
    3: 
    4: %h3 Current portals:
    5: = render @portals
  app/views/portals/index.haml:2:in `_app_views_portals_index_haml___3074475544725108295_70221306145460'

在查看production.rb和development.rb之间的差异时,我发现了设置

config.eager_load = false

在production.rb中,错误就消失了。但是,我想将config.eager_load的默认设置保持为true。有没有人对为什么会发生这种情况有任何想法?

portals_controller.rb

def index 
    @portals = Portal.all 
end

门户/ index.haml

%h2
  = link_to "New portal", new_portal_path

%h3 Current portals:
= render @portals

门户/ _portal.haml

%p
  = link_to portal.name, portal

配置/ routes.rb中

******::Application.routes.draw do
  root to: 'portals#index'

  resources :portals, shallow: true do
    resources :webpages do
      resources :documents
    end
  end

  mount Resque::Server, at: "/resque"
end

我在VPS上使用unicorn和nginx。

0 个答案:

没有答案