1
votes

I've got an app I just converted to Rails 3.1. In my app/assets/stylesheets I have a bunch of sass files that use @import to import parial sass files. One of these files is called screen.sass and it's the main sass file that I want to use in one of my layouts.

However, when I run

RAILS_ENV=demo bundle exec rake assets:precompile

I get that screen isn't precompiled (in ../app/assets/stylesheets/screen.sass)

It wasn't getting compiled at all with no message without adding this to demo.rb

config.assets.precompile += %w( screen.css )

I've tried several things like renaming the screen.sass file to screen.css.sass and I've tried creating a manifest file called screen.css in my app/assets/stylesheets directory and requiring the screen.sass file. In each case I get the same precompile error for it as above.

I'm not precompiling with the production environment because demo is my staging environment I want to test the 3.1 upgrade on.

Anybody have any ideas as to what else I can try to fix this error?

1
I know this is super old but I'm actually seeing this same issue with rails 4. Many (most) sass files are being precompiled correctly but one isn't, oddly it works in development and gets compiled on the fly but completely ignored by assets:precompilethom_nic
Looks like I needed the file to be called blah.css.sass and I needed config.assets.precompile += %w( blah.css ) even though the config comment says "...all non-JS/CSS are already added"thom_nic

1 Answers

2
votes

rake assets precompile needs to know what type of file to compile your stylesheet to. Change screen.sass to screen.css.sass