0

I have a Phusion install, configured with Rails 3.0.10 and Apache 2, and assets like CSS and Javascript are apparently being served, but not utilized by the browser.

So for instance when I hit the root url, the page renders, but CSS and javascripts are not used by the browser. I see GET requests coming through for each asset in the access logs.

I can visit those assets directly in my browser, going to stylesheets/application.css?1313636333 I see the correct application.css

I dont see permission errors in production logs, or apache error logs.

My VHost looks like:

<VirtualHost *:80>
  ServerAdmin info@example.com
  ServerName portal.example.com
  DocumentRoot /app/example/public
  <Directory /app/example/public>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>
Allyl Isocyanate
  • 13,306
  • 17
  • 79
  • 130

1 Answers1

1

Since you can access your static assets, the mime-type incorrectness might be the cause.

Take the output of the following:

curl --head http://portal.example.com/stylesheets/application.css

the result should contains "Content-Type: text/css"

inntran
  • 993
  • 7
  • 8
  • Good suggestion. Unfortunately yes it returns content type text/css – Allyl Isocyanate Aug 18 '11 at 19:34
  • HTTP/1.1 200 OK Date: Thu, 18 Aug 2011 19:33:06 GMT Server: Apache Last-Modified: Thu, 18 Aug 2011 02:58:53 GMT ETag: "17f5a9-441-4aabecb087a21" Accept-Ranges: bytes Content-Length: 1089 Vary: Accept-Encoding Content-Type: text/css – Allyl Isocyanate Aug 18 '11 at 19:34
  • Try using your browsers debugging function to trace network activities – inntran Aug 18 '11 at 20:51
  • It turned out it was some SASS/Flutie issue. Couldn't pinpoint it but looking at a good version locally and blowing away all of the SASS mumbo jumbo fixed it. Thanks for everyones suggestions – Allyl Isocyanate Aug 19 '11 at 03:13