rails/rails — Issue #4151: CSS file has already been included when precompiling assets
Author: larspind
Created: 2011-12-23 18:49:33+00:00
State: open

STEPS TO REPRODUCE:

1) Setup a fresh Rails 3.2RC1 project
2) Edit app/assets/stylesheets/application.css to say

//= require_tree ./global

3) Create app/assets/stylesheets/global/stuff.css.scss (NOTE: Must be an .scss file). Just leave it empty.

4) Add this line to config/environments/development.rb:

config.assets.digest = true

5) On the shell, in Rails root, say:

rake assets:precompile

RESULT:

rake aborted!
/Users/lars/Sites/asset-test/app/assets/stylesheets/global/stuff.css.scss has already been required
(in /Users/lars/Sites/asset-test/app/assets/stylesheets/global/stuff.css.scss)

Tasks: TOP => assets:precompile:primary

EXPECTED RESULT:

Precompiled assets :)

I've created a public repo for this in case you want to test it out.

https://github.com/larspind/rails-3-2-asset-precompile-bug

Clone URL is here: git://github.com/larspind/rails-3-2-asset-precompile-bug.git

I spent a couple hours trying to track down the root cause, but didn't figure it out.

//Lars