Rails 3.2.12 with less and Twitter Bootstrap: V8 Error



我想在当前的Ruby on Rails版本中使用Twitter Bootstrap。我尝试使用"less-rails-bootstrap"。我跟着:http://rubysource.com/twitter-bootstrap-less-and-sass-understanding-your-options-for-rails-3-1/

我创建了一个新的rails项目。然后我添加了"gem 'less-rails-bootstrap'"到Gemfile,安装它,之后我添加了"*= require twitter/bootstrap"到application.css

我得到这个错误:

Showing /var/www/lrb/app/views/layouts/application.html.erb where line #5 raised:
V8::Error
(in /usr/lib/ruby/gems/1.8/gems/less-rails-bootstrap-2.3.0/vendor/assets/stylesheets/twitter/bootstrap.css.less)

我找不到如何修复V8::错误。application.html.erb: <%= stylesheet_link_tag "application",:media => "all" %>

My installed Gem's:

Using rake (10.0.3) 
Using i18n (0.6.4) 
Using multi_json (1.6.1) 
Using activesupport (3.2.12) 
Using builder (3.0.4) 
Using activemodel (3.2.12) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.1) 
Using tilt (1.3.4) 
Using sprockets (2.2.2) 
Using actionpack (3.2.12) 
Using mime-types (1.21) 
Using polyglot (0.3.3) 
Using treetop (1.4.12) 
Using mail (2.4.4) 
Using actionmailer (3.2.12) 
Using arel (3.0.2) 
Using tzinfo (0.3.36) 
Using activerecord (3.2.12) 
Using activeresource (3.2.12) 
Using coffee-script-source (1.6.1) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.3) 
Using json (1.7.7) 
Using rdoc (3.12.2) 
Using thor (0.17.0) 
Using railties (3.2.12) 
Using coffee-rails (3.2.2) 
Using commonjs (0.2.6) 
Using jquery-rails (2.2.1) 
Using less (2.2.2) 
Using less-rails (2.2.6) 
Using less-rails-bootstrap (2.3.0) 
Using libv8 (3.11.8.13) 
Using bundler (1.3.0) 
Using rails (3.2.12) 
Using ref (1.0.2) 
Using sass (3.2.6) 
Using sass-rails (3.2.6) 
Using sqlite3 (1.3.7) 
Using therubyracer (0.11.4) 
Using uglifier (1.3.0)

如何使用Bootstrap与Rails 3.2.12?非常感谢您的帮助!

我使用'bootstrap-sass' gem,但我认为它遵循相同的惯例。

绑定gem之后,我没有在application.css中添加任何东西;根据gem的文档:

我们不建议使用//= require指令,因为你的其他样式表将能够使用这些很棒的mixinsBootstrap已经定义了

你可以创建一个新的css。@import 'bootstrap';

工作!

我曾经遇到过同样的问题,我切换到anjlab Bootstrap rails,它提供了Twitter Bootstrap CSS(带有Sass风格)

gem 'anjlab-bootstrap-rails', '>= 2.3', :require => 'bootstrap-rails'

如果你是在Windows下得到它,这应该会帮助你https://github.com/hiranpeiris/therubyracer_for_windows

最新更新