I am using Rails 3.1 and in my assets/stylesheets I have bunch of .css and .scss files.
It seems Rails is trying to precompile .css files and they blow up with following message:
Invalid CSS after "...{padding-bottom": expected "{", was ";0;}#order_deta..."
If I have only .css files and if I comment out sass-rails gem from Gemfile then everything works.
group :assets do
#gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
So now the question is, do I have to convert all my .css into .scss to play nice with asset precompilation or is there a workaround?
Update:
Here is my code:
config.assets.paths << "#{Rails.root}/app/themes/vanilla/assets/stylesheets"
config.assets.paths << "#{Rails.root}/app/themes/vanilla/assets/javascripts"
config.assets.paths << "#{Rails.root}/app/themes/vanilla/assets/images"
config.assets.precompile += ['vanilla.css', 'vanilla.js']
vanilla.css looks like this:
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. 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 'reset'
*= require 'vroom'
*= require_self
*/
Here reset is reset.css and vroom is vroom.css.scss
This is the error I am getting:
Invalid CSS after "...{padding-bottom": expected "{", was ";0;}#order_deta..."
(in .........../stylesheets/vanilla.css)
This error is happening because Rails is trying to precompile reset.css.
If I remove the sass-rails gem and all .scss files then rake assets:precompile works.
sass-railslater? If not, it seems that comment it is the best approach.