无法找到文件' bootstrap'但它存在

时间:2016-05-16 05:38:37

标签: ruby-on-rails ruby twitter-bootstrap ruby-on-rails-4 asset-pipeline

我从git克隆了一个Rails 4.1.7项目,现在有一个例外:

couldn't find file 'bootstrap'
  (in my_app/app/assets/stylesheets/application.css:13)

我的appli-on.css:

 *= require bootstrap
 *= require font-awesome
 *= require s3_direct_upload_progress_bars
 *= require_tree .
 *= require_self
 */

的Gemfile:

gem 'bootstrap-sass'

1 个答案:

答案 0 :(得分:2)

根据README ...

您需要确保在bootstrap-sass中安装了sass-railsGemfile个宝石:

gem 'bootstrap-sass', '~> 3.3.6'
gem 'sass-rails', '>= 3.2'

您还需要将application.css更改为application.scss。它看起来像这样:

@import "bootstrap-sprockets";
@import "bootstrap";

//= require font-awesome
//= require s3_direct_upload_progress_bars
//= require_tree .
//= require_self