Ruby on rails 包含boostrap时预编译资产失败

Ruby on rails 包含boostrap时预编译资产失败,ruby-on-rails,twitter-bootstrap,sass,Ruby On Rails,Twitter Bootstrap,Sass,我正在尝试在生产中预编译资产。但是我在包含下面的文件时出错了 bootstrap\u style.sass @import bootstrap a color: #6b9029 /* *= require_self *= require jquery-ui *= require prettyPhoto.css *= require prettyLoader.css *= require prettyPopin.css *= require prettyPhoto.css *= requir

我正在尝试在生产中预编译资产。但是我在包含下面的文件时出错了

bootstrap\u style.sass

@import bootstrap
a
  color: #6b9029
/*
*= require_self
*= require jquery-ui
*= require prettyPhoto.css
*= require prettyLoader.css
*= require prettyPopin.css
*= require prettyPhoto.css
*= require sass/main
*= require sass/master
*= require sass/ie
*= require sass/ie8
*= require sass/buy_now
*= require sass/ssl_seal
*= require font-awesome
*/

/*
TODO: I had to remove the site report from the main import here.
This will need to be added back and loaded only on the site report page only
or figure out why the styles are conflicting with the main layout
require sass/site_report
*/
  @include box-shadow(0 0 1px 1px rgba(255, 255, 255, 0.4) inset)
application.css

@import bootstrap
a
  color: #6b9029
/*
*= require_self
*= require jquery-ui
*= require prettyPhoto.css
*= require prettyLoader.css
*= require prettyPopin.css
*= require prettyPhoto.css
*= require sass/main
*= require sass/master
*= require sass/ie
*= require sass/ie8
*= require sass/buy_now
*= require sass/ssl_seal
*= require font-awesome
*/

/*
TODO: I had to remove the site report from the main import here.
This will need to be added back and loaded only on the site report page only
or figure out why the styles are conflicting with the main layout
require sass/site_report
*/
  @include box-shadow(0 0 1px 1px rgba(255, 255, 255, 0.4) inset)
错误

rake aborted!
Sass::SyntaxError: Invalid CSS after "...lor}: #{$value}": expected "{", was ";"
/var/lib/gems/2.6.0/gems/bootstrap-4.4.1/assets/stylesheets/bootstrap/_root.scss:5
SassC::SyntaxError: Error: Undefined operation: "prefix-usage(browser-prefixes(browsers()), css-boxshadow, (full-support: true), (partial-support: true)) gt 0.1".
        on line 324:7 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in function `use-prefix`
        from line 208:33 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in function `prefixes-for-capability`
        from line 218:40 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in mixin `with-each-prefix`
        from line 360:12 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in mixin `prefixed-properties`
        from line 43:12 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_box-shadow.scss, in mixin `box-shadow`
        from line 3902:12 of app/assets/stylesheets/sass/main.sass
>>   @if $usage > $threshold {

   ------^
更新错误

rake aborted!
Sass::SyntaxError: Invalid CSS after "...lor}: #{$value}": expected "{", was ";"
/var/lib/gems/2.6.0/gems/bootstrap-4.4.1/assets/stylesheets/bootstrap/_root.scss:5
SassC::SyntaxError: Error: Undefined operation: "prefix-usage(browser-prefixes(browsers()), css-boxshadow, (full-support: true), (partial-support: true)) gt 0.1".
        on line 324:7 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in function `use-prefix`
        from line 208:33 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in function `prefixes-for-capability`
        from line 218:40 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in mixin `with-each-prefix`
        from line 360:12 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in mixin `prefixed-properties`
        from line 43:12 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_box-shadow.scss, in mixin `box-shadow`
        from line 3902:12 of app/assets/stylesheets/sass/main.sass
>>   @if $usage > $threshold {

   ------^
main.sass

@import bootstrap
a
  color: #6b9029
/*
*= require_self
*= require jquery-ui
*= require prettyPhoto.css
*= require prettyLoader.css
*= require prettyPopin.css
*= require prettyPhoto.css
*= require sass/main
*= require sass/master
*= require sass/ie
*= require sass/ie8
*= require sass/buy_now
*= require sass/ssl_seal
*= require font-awesome
*/

/*
TODO: I had to remove the site report from the main import here.
This will need to be added back and loaded only on the site report page only
or figure out why the styles are conflicting with the main layout
require sass/site_report
*/
  @include box-shadow(0 0 1px 1px rgba(255, 255, 255, 0.4) inset)

您可以通过运行
sass-c app/assets/stylesheets
来检查文件的语法。这可能会为您发现问题

您还可以检查此github引用


这帮助我跟踪了一个问题。但是我现在遇到了这个错误,
error:Invalid CSS在“…ain import here”之后出现:app/assets/stylesheets/application.CSS Use--trace的第18行上的预期表达式(例如1px,粗体)was“。我将在上面发布该文件,删除该文件的注释部分会产生错误
error:Invalid CSS after”*“:应为选择器,在app/assets/stylesheets/application.css的第2行中为“=require_self”。我编辑了我的答案内容,请您现在再试一次我想你可以使用一些在线css验证工具来验证你的css。或者试试下面的帖子:
bootstrap\u style.sass
文件的语法错误?为什么没有
{}