Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stylesheet_link_tag(:all) generates reference to `all.css` on Heroku

I have stylesheet_link_tag(:all) in my layout.

It behaves as expected on local machine, even when I run it in production environment (rails s -e production).

By expected I mean that it emits all the links to existing stylesheets without concating them into all.css and it does not emit the link to all.css.

But when I deploy it to Heroku, the result is the same plus a link to all.css in the beginning. This is what I don't want and don't expect, especially when production environment on local machine does not emit it.

So the question is how do I get rid of all.css link on Heroku without specifying all files manually?

Thanks.

like image 882
Dmytrii Nagirniak Avatar asked Mar 30 '11 15:03

Dmytrii Nagirniak


1 Answers

Heroku is doing some special handling of asset files, see for example: http://devcenter.heroku.com/articles/rails3 and Why does a rails app on heroku serve assets via all.css and locally via individual files especially the final comment about :cache => true working now and about File.open operations not working.

They aren't expecting your use case as the most common, so it is possible that there is some bug in their handling. I would try explicitly setting :cache => false and :config => false

like image 96
Ray Baxter Avatar answered Oct 06 '22 01:10

Ray Baxter