2012-03-18 33 views
2

嘗試使用Rails 3.2.2運行以下代碼,切換到3.2.1並嘗試使用另一臺計算機來查看它是否與核心/操作系統相關。bootstrap:主題錯誤常量NameError - > const_defined?

我嘗試:

rails g bootstrap:themed events 

我得到:

.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:229:in `const_defined?': wrong constant name event (NameError) 
    from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:229:in `block in constantize' 
    from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:228:in `each' 
    from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:228:in `constantize' 
    from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/core_ext/string/inflections.rb:54:in `constantize' 
    from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/twitter-bootstrap-rails-2.0.4/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns' 
    from (erb):6:in `template' 

回答

6

無需降級寶石版本。相反,只是改變:

rails g bootstrap:themed events 

到:

rails g bootstrap:themed Events 

你需要利用和複數化型號,這是愚蠢的,但它的工作原理

+1

謝謝你,這個工作對我來說 – deb 2012-03-22 16:00:35

+1

我沒有模型。我只是使用控制器。我如何相處? – 2012-06-26 08:03:01

4

我得到了同樣的錯誤。在搜索類似的錯誤之後 - 我認爲它必須是最新版本的bootstrap的問題,因爲我之前沒有收到這個錯誤。

我得到了2.0.4版的錯誤。 Gemfile中的以下行跟着「bundle install」爲我解決了它。

寶石「Twitter的引導護欄」,「2.0.2」

相關問題