I'm a bit confused as it seems like the application.css is including itself twice, once when it lists the resources from the manifest and then a cache of that. So when I delete an individual file it still seems to stay alive inside the application.css file.
/* *= require twitter/bootstrap *= require_self *= require_tree ./common *= require_tree ./helpers */
Which works as expected and outputs in dev mode all the relevant individual files
# Do not compress assets config.assets.compress = false # Expands the lines which load the assets config.assets.debug = true
<link href="/assets/twitter/bootstrap.css?body=1" media="screen" rel="stylesheet" type="text/css" /> <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" /> <link href="/assets/common/announcement.css?body=1" media="screen" rel="stylesheet" type="text/css" /> <link href="/assets/common/button.css?body=1" media="screen" rel="stylesheet" type="text/css" /> <Blah blah>
This should be blank? Since all I have in my application.css file is the manifest and no actual css but instead i get all my concatenated code 106kb long.
IE if I remove a file in the common directory, it doesn't go away. It is no longer listed in the output but the css still appears from the application.css
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB. Prior to Rails 3.1 these features were added through third-party Ruby libraries such as Jammit and Sprockets.
I had a problem like this before. It was caused after I had precompiled the assets it was going after the applcation.css inside the public folder as well as in the apps directory. I'm not sure how to fix it so that it doesn't keep happening while in dev mode but if you delete your /public/assets
directory it should fix it.
Check and see if you have a public/assets folder, if you do and it's full, it's probably why you're seeing double.
There is currently (2012-09-24) a bug in rails/sprockets causing it to not properly detect imported files.
This should be fixed in rails 3.2.9 and later but in the mean time, you can work around it as follows:
You should now be seeing the correct css.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With