升级后编译资产时出错 bootstrap

Error compiling assets after upgrading bootstrap

我正在尝试在 Rails 应用程序的 Ruby 中升级 bootstrap 版本。使用纱线从 4.0.0-alpha.6 迁移到 4.1 后,我在 运行 rails assets:precompile

时收到此错误

错误

SassC::SyntaxError: Error: Undefined variable: "$alert-warning-bg".
        on line 32:20 of app/assets/stylesheets/variables/_helpers.scss
        from line 47:9 of app/assets/stylesheets/variables.scss
        from line 9:9 of app/assets/stylesheets/application.scss
        from line 1:9 of app/assets/stylesheets/admin.scss
>>   outline: lighten($alert-warning-bg, 9%);

helper.scss

.highlight {
  outline: lighten($alert-warning-bg, 9%);
}

$alert-warning-bg4.1 上被删除并替换为 theme-color-level($color, $alert-bg-level) mixin(让它变干?)。使用示例:

theme-color-level('warning', $alert-bg-level)

或具体针对您的情况:

lighten(theme-color-level('warning', $alert-bg-level), 9%)