Rails 3.2 Asset Pipeline with Passenger Endless Er

2019-07-25 03:08发布

问题:

Having recently migrated my app to 3.2.1, it would seem I'm another developer struggling with the asset pipeline.

Everything looks ok, my assets are compiled and apparently served. In the source of my doc I can see this:

 <link href="/assets/application-4fac522109a7afaaa2f18ef9f1294e19.css" media="screen" rel="stylesheet" type="text/css" />

And the link works just fine. However, neither my js or css actually load.

The only error I can actually see in the apache logs is this:

 cache: [GET /] miss

I have adjusted my apache configuration to include:

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

Am deploying with capistrano and passenger.

Has anyone out there run into this issue?

回答1:

Always make sure you wipe out /your_app_path/tmp/cache. I usually wipe out the public/assets also. Then do a compile and restart the app. Many times this solves odd issues with the pipeline for me.