关于SO,已经存在类似的问题,但是没有足够明确的答案来理解以下问题。
我的目标是使用Bower使用Bootstrap设置Rails 5。
使用Bower,我在以下文件夹中安装了Bootstrap:
vendor/assets/bower_components/bootstrap-sass
然后,我更新了初始化器/资产:
Rails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')
然后我将gem'sass -rails'添加到Gemfile并更新了application.js:
//= require jquery
//= require bootstrap-sass/assets/javascripts/bootstrap
//= require jquery_ujs
//= require turbolinks
//= require_tree .
JS的资产似乎运行良好:如果我加载http:// localhost:3000 / assets / application.js,我可以看到Bootstrap JS部分已添加到那里。
问题是关于Sass(SCSS)的:我将bootstrap-sass / assets / stylesheets / bootstrap添加到application.css.scss中,但没有成功:
/*
*= require_tree .
*= require_self
@import "bootstrap-sass/assets/stylesheets/bootstrap";
*/
实际上,如果我加载http:// localhost:3000 / assets / application.css,我会看到:
/*
@import "bootstrap-sass/assets/stylesheets/bootstrap";
*/
(@import上指定的文件夹包含许多_ *。scss文件和一个mixins文件夹)
问题是:
PS:任何了解该问题的资源将不胜感激。
移动导入,因此它位于 /* .. */
/*
*= require_tree .
*= require_self
*/
@import "bootstrap-sass/assets/stylesheets/bootstrap";
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句