bootstrap:主题错误的常量NameError – > const_defined?

尝试使用Rails 3.2.2运行以下命令,切换到3.2.1并尝试使用另一台机器来查看它是否与核心/操作系统相关。

我试试:

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' 

无需降级gem版本。 相反,只需改变:

 rails g bootstrap:themed events 

至:

 rails g bootstrap:themed Events 

你需要对模型名称进行大写和复数化,这是愚蠢的,但它确实有效

我得到了同样的错误。 在搜索类似的错误后 – 我认为它必须是最新版本的bootstrap的问题,因为我之前没有收到此错误。

我在2.0.4版本中遇到了错误。 Gemfile中的以下行后跟“bundle install”为我解决了这个问题。

gem’twitter-bootstrap-rails’,’2.0.2′