I am fairly new to ruby on rails, I have been trying to use twitter-bootstrap as an asset, so I have included it in my Gemfile, bundled and it installs successfully. However I have noticed that it relies on certain dependencies that are not shown when I do the "bundle" command.

The dependences it needs

(1) Libv8
(2) Less
(3) Less-rails

Error message:

cannot load such file -- less
  (in c:/Sites/todo/app/assets/stylesheets/bootstrap_and_overrides.css.less)

[code]

Extracted source (around line #8):

5:   <!--[if lt IE 9]>
6:     <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"     type="text/javascript"></script>
7:   <![endif]-->
8:   <%= stylesheet_link_tag    "application", :media => "all" %>
9:   <%= javascript_include_tag "application" %>
10:   <%= csrf_meta_tags %>
11:   <meta name="viewport" content="width=device-width, initial-scale=1.0">

[/code]

Trace
app/views/layouts/application.html.erb:8:in     `_app_views_layouts_application_html_erb__560528188_27183396'
app/controllers/lists_controller.rb:7:in `index'

I have noticed a lot of answers to this very question already, and have chosen the obvious solutions, but somehow I still get stuck, and would really appreciate some guidance.

推荐答案

I guess you are using sass instead of LESS.

Have you tried the twitter-bootstrap-rails gem?

gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"

https://github.com/seyhunak/twitter-bootstrap-rails

Ruby-on-rails相关问答推荐

为什么这个rails Collection_select不呈现关联属性?

Gemfile需要较新版本的依赖项

Rails:has_many 通过不返回结果

序列化来自关联的不可变数据是个好主意吗?

Rails:序列化数据库中的对象?

ActiveRecord 包括.指定包含的列

如何在 Rails 3 中使用 Capybara 单击具有相同文本的第二个链接?

在 Rails 3.2 中更新多行

Rails ActiveRecord:验证单个属性

RSpec 设置会话对象

使用 Devise 令牌登录,这是内置的吗?

是否可以在 Rails 中否定范围?

警告:引用了顶级常量

错误:无法构建 gem 原生扩展 - 安装 mysql2 时出错

如何使用 Rails 3 获取请求的目标控制器和操作?

如何在 Rails 应用程序中测试 ElasticSearch (Rspec)

用于在多行上链接调用的 Ruby 约定

ActionMailer 在开发 Rails 4 中不发送邮件

Ruby 更新后:测试失败,assets资源 未声明为在生产中预编译

为什么 rails bootstrap 这么慢,我该怎么办?