Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Precompile Assets Rails 4 bootstrap-sass DXImageTransform error [duplicate]

Im trying to precompile assets for production. Unless I include the bootstrap and font-awesome assets as static files (or host from CDN) sass-rails fails when trying to compile assets on production. My Gemfile looks like this:

# 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'

When i try to compile assets i get the following error:

➜  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 file:

 * 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 .
 */

My scss file:

@import "font-awesome-sprockets";
@import "font-awesome";
@import "bootstrap-sprockets";
@import "bootstrap";

I've seen this issue reported here: https://github.com/rails/sass-rails/issues/37 but that issue is several years old.

like image 249
doug Avatar asked Nov 04 '14 00:11

doug


1 Answers

Remove the white space between progid and DXImageTransform.Microsoft.gradient.

for ex.,

OLD SYNTAX

filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important;

NEW SYNTAX

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important;

You can see in the NEW SYNTAX, I have removed extra space between progid and DXImageTransform.Microsoft.gradient().

like image 69
Parthiv Avatar answered Sep 28 '22 19:09

Parthiv