问题
Is there something else that needs to be referenced/configured when upgrading the bootstrap-sass gem to ~> 3.2.0
?
Using RubyMine 6.3 as the editor and the following in the Gemfile:
ruby '2.1.2'
gem 'rails', '4.1.1'
gem 'sass-rails', '~> 4.0.3'
gem 'bootstrap-sass', '3.1.1.1'
app/assets/stylesheets/application.css.scss will be happy with
@import 'bootstrap';
However, once the bootstrap-sass gem is upgraded to its current version by changing the Gemfile reference to (and then running bundle update):
gem 'bootstrap-sass', '~> 3.2.0'
RubyMine now has issues the @import 'bootstrap';
statement, saying "Cannot resolve import into sass/scss file".
The twbs/bootstrap-sass installation docs don't seem to infer that anything else is needed...
回答1:
Remove all the *= require_self and *= require_tree . statements from the sass file. Instead, use @import to import Sass files.
Do not use *= require in Sass or your other stylesheets will not be able to access the Bootstrap mixins or variables.
来源:https://stackoverflow.com/questions/24939189/issue-with-upgrade-to-bootstrap-sass-3-2-0