gpt4 book ai didi

ruby-on-rails-4 - 无法预编译 Assets Rails 4 bootstrap-sass DXImageTransform 错误

转载 作者:行者123 更新时间:2023-12-04 01:49:03 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





“non-terminal statement or declaration” error when using Microsoft's proprietary filter property in Sass

(1 个回答)


5年前关闭。




我正在尝试为生产预编译 Assets 。除非我将 bootstrap 和 font-awesome Assets 作为静态文件(或来自 CDN 的主机)包含在内,否则 sass-rails 在尝试在生产中编译 Assets 时会失败。我的 Gemfile 看起来像这样:

# Default asset gems
gem 'coffee-rails', '~> 4.0.0'
gem 'sass-rails' , '~> 4.0.3'
gem 'uglifier' , '>= 1.3.0'

# Default gems
gem 'jbuilder', '~> 2.0'
gem 'sdoc' , '~> 0.4.0', group: :doc

# Added gems
gem 'carrierwave'
gem 'pg'
gem 'turbolinks'
gem 'restforce'

# Asset gems
gem 'jquery-rails'
gem 'autoprefixer-rails'
gem 'bootstrap-sass'
gem 'font-awesome-sass'
gem 'handlebars_assets'
gem 'iconv'

当我尝试编译 Assets 时,出现以下错误:
➜  stylesheets git:(master) ✗ rake assets:precompile
(in /home/ubuntu/spice-conduit)
rake aborted!
Sass::SyntaxError: Invalid CSS after " filter: progid": expected ";", was ": DXImageTransf..."
(in /home/ubuntu/spice-conduit/app/assets/stylesheets/application.css)
(sass):3566
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:1147:in `expected'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:1085:in `expected'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:1080:in `tok!'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:586:in `block in declaration_or_ruleset'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:1123:in `call'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:1123:in `rethrow'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:592:in `declaration_or_ruleset'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:554:in `block_child'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:546:in `block_contents'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:535:in `block'
/home/ubuntu/.rvm/gems/ruby-2.1.3/gems/sass-3.2.19/lib/sass/scss/parser.rb:529:in `ruleset'

app.css 文件:
 * You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require jquery-ui
*= require sweetalert
*= require vendors
*= require_tree .
*/

我的 scss 文件:
@import "font-awesome-sprockets";
@import "font-awesome";
@import "bootstrap-sprockets";
@import "bootstrap";

我在这里看到了这个问题的报告: https://github.com/rails/sass-rails/issues/37
但这个问题已经有好几年了。

最佳答案

删除 progid 之间的空白和 DXImageTransform.Microsoft.gradient .

例如,

旧语法
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important;
新语法
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important;
您可以在 NEW SYNTAX 中看到,我删除了 progid 之间的多余空格和 DXImageTransform.Microsoft.gradient() .

关于ruby-on-rails-4 - 无法预编译 Assets Rails 4 bootstrap-sass DXImageTransform 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26725986/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com