Ben Scheib
Ben Scheib

Reputation: 392

Sass Not Precompiling on Rails 3.1 Asset Pipeline, Assets:precompile rake task

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?

Upvotes: 1

Views: 2127

Answers (1)

Erik Petersen
Erik Petersen

Reputation: 2357

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

Upvotes: 2

Related Questions