1

我正在尝试设置机车 CMS 并在本地运行,但我遇到了这个错误:

NoMethodError in Locomotive/pages#index

Showing /Users/dennismonsewicz/.rvm/gems/ruby-1.9.3-p125/gems/locomotive_cms-2.0.0.rc4/app/views/locomotive/pages/_page.html.haml where line #4 raised:

undefined method `count' for nil:NilClass
Extracted source (around line #4):

1: - if page.not_found?
2:   %li.sep  
3: 
4: %li{ :id => "item-#{page.id}", :class => "page #{css_for_page(page)}" }
5: 
6:   - children = can?(:manage, page) ? page.children : page.children.find_all { |p| !p.templatized? }
7: 

还有其他人遇到机车这个问题吗?

机车宝石:gem 'locomotive_cms', '~> 2.0.0.rc.4', :require => 'locomotive/engine'

我能够获得管理员用户设置,但是当您完成初始设置后,应用程序会将您重定向到 /locomotive/pages,然后我收到该错误

4

1 回答 1

3

在机车的文档中,他们声明在您的 Gem 文件中执行以下操作: gem 'locomotive_cms', '~> 2.0.0.rc4', :require => 'locomotive/engine'

但您实际上必须执行以下操作: gem 'locomotive_cms', :require => 'locomotive/engine', :git => "git://github.com/locomotivecms/engine.git"

于 2012-04-11T15:17:53.180 回答