我刚刚更新了我的rails应用程序的宝石与宝石更新和捆绑更新.当我试图用rails测试它,它给我这个错误:
/Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/railtie/configuration.rb:85:inmethod_missing’:undefined method less’for#< Rails ::应用::配置:0x0000010308a300> (NoMethodError) 其余的错误消息如下所示:
from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/twitter-bootstrap-rails-2.1.6/lib/twitter/bootstrap/rails/engine.rb:15:in `block in <class:Engine>' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing' from /Users/Richard/Code/Rails/rgsimms/config/environment.rb:5:in `<top (required)>' from /Users/Richard/Code/Rails/rgsimms/config.ru:4:in `require' from /Users/Richard/Code/Rails/rgsimms/config.ru:4:in `block in <main>' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' from /Users/Richard/Code/Rails/rgsimms/config.ru:1:in `new' from /Users/Richard/Code/Rails/rgsimms/config.ru:1:in `<main>' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.4.1/lib/rack/server.rb:200:in `app' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/commands/server.rb:46:in `app' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.4.1/lib/rack/server.rb:252:in `start' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap' from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
这是Twitter Bootstrap宝石的错误吗?我还在学习如何得到这个固定的?任何帮助都很棒
解决方法
叽叽witter witter的引导宝石取决于宝石越少.从
the docs:
gem "therubyracer" gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS gem "twitter-bootstrap-rails"
我亲自发现twitter引导程序更容易将文件从official site转储到vendor / assets目录中.从宝石更新比手工更容易,但更新bootstrap时,您有意做“手工”,并且通过眼睛检查全部 – 我更喜欢额外的努力,以确保它不会做得很轻此外,很难从宝石中删除某些(例如)响应部分,而没有(据我所知)“未指定”样式.响应的内容从版本到版本都有变化,所以你不能只依靠它一切工作.我真的看不到使用宝石的任何优势.
更新
现在有一个官方的宝石,我建议退房:https://github.com/twbs/bootstrap-sass