Rails 3.2 Asset Pipeline with Thin and Apache, not finding assets Rails 3.2 Asset Pipeline with Thin and Apache, not finding assets apache apache

Rails 3.2 Asset Pipeline with Thin and Apache, not finding assets


Delete the following lines from your Apache configuration.

ProxyPass / balancer://thinservers/ProxyPassReverse / balancer://thinservers/

The answer came from In Rails, should I enable serve_static_assets?.


Typically, your assets should only exist in /public/assets for a deployed application.

Apache should be configured so that its DocumentRoot is your RAILS_ROOT/public. Then it will serve http://example.com/assets/whatever.css from RAILS_ROOT/public/assets/whatever.css, and it never goes through Rails for static assets.

Have you restarted your application since you precompiled your assets? Sometimes Rails is expecting an older/newer compiled version of your assets than is currently deployed.


I've been having this problem for days now. Thought it was an issue with capistrano or the ruby version however I'm pretty sure it's permissions related too.

My configuration was pretty much the same as yours although I'm also using Unicorn.

Here's what I did to sort:

  1. Temporarily remove the following section because I think that was causing problems with the troubleshooting:

     <LocationMatch "^/assets/.*$">  Header unset ETag    FileETag None    ExpiresActive On    ExpiresDefault "access plus 1 year"  </LocationMatch>

Perhaps get it all working and then add it back in. I don't think it's the cause of the problems however, when diagnosing things like this, it's best to remove as much as you can to find the culprit.

  1. Run a chown -R xxx.xxx (replace xxx with your application user or web user) on the public directory. As soon as I did so, the css appeared again.

  2. (What I did but maybe not essential) You might also want to install locally without cap. just in case there's an issue with it. That also worked for me.

  3. Completely wipeout tmp/cache and public/* just in case.

  4. Restart your apache server a couple of times.

You can see a gist of my conf. here