所以我正在尝试实现'bootstrap-tour'宝石。 Rails 5附带了一个application.scss文件,但是'bootstrap-tour'gem文档要求将以下代码放在application.css文件中
*= require bootstrap-tour
所以我创建了一个application.css文件并将代码放在那里但是如果真的混淆了我放在scss文件中的样式。如果我将上面的代码放在app.scss文件中,我会收到以下错误
couldn't find file 'bootstrap-tour' with type 'text/css'
的Gemfile
gem 'carrierwave'
gem 'acts_as_votable', '~> 0.11.1'
gem 'devise', '~> 4.4', '>= 4.4.1'
gem 'will_paginate', '~> 3.1.0'
gem 'bootstrap-sass', '~> 3.4.1'
gem 'flexbox-rails', '~> 1.0'
gem 'rails_12factor'
gem 'bootstrap-tour-rails'
application.scss
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
(And some custom styling here)
这些是链轮处理的“魔术评论”。对于css / scss,它们只是文件开头的/* */
注释块。
你缺少打开/*
:
/*
*= require 'some_file'
*/
但SCSS / SASS suggests使用@import
而不是sprockets require
s - 这样sass变量和mixin将在文件中正确处理。