试图通过heroku上的bootstrap-sass导入bootstrap但是收到错误

我有一个rails应用程序,我正在尝试使用bootstrap-sass在heroku上导入bootstrap,遵循以下指示: https : //github.com/thomas-mcdonald/bootstrap-sass

在我的application.css中,我有:

@import "bootstrap"; /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * */ @import "overrides.css.scss"; 

但是当我git push heroku master时出现以下错误。

 -----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! File to import not found or unreadable: bootstrap. Load path: /tmp/build_8elam02dzb95 (in /tmp/build_8elam02dzb95/app/assets/stylesheets/application.css) (sass):1 /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:67:in `rescue in import' /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:45:in `import' /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:28:in `imported_file' /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:37:in `css_import?' /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/visitors/perform.rb:217:in `visit_import' /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/visitors/base.rb:37:in `visit' /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/visitors/perform.rb:100:in `visit' 

我究竟做错了什么?

编辑#1输出显示bootstrap-sass已安装

 -----> Ruby/Rails app detected -----> Installing dependencies using Bundler version 1.3.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment Using rake (10.0.3) Using i18n (0.6.4) Using multi_json (1.6.1) .... Using sass (3.2.7) Using bootstrap-sass (2.2.2.0) Using coffee-script-source (1.6.1) 

已经有一段时间了,所以不确定这是否仍然相关。 看来你的application.css应该被命名为application.css.scss,以便Sass处理它。 否则,正常的CSS @import指令不会知道Sass Bootstrap。

我宁愿建议不要重命名application.css,而是创建一个名为custom.css.scss的新文件

@import“bootstrap”;

那里。 还要确保你的gemfile中有sass-rails gem。
以上配置对我来说很好。 我的application.css看起来像这样:

 * *= require_self *= require_tree . */