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 [email protected]
  ServerName portal.example.com
  DocumentRoot /app/example/public
  <Directory /app/example/public>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>
2
  • I think I had an error similar to this. What does the relevant portion of routes.rb look like? Commented Aug 18, 2011 at 18:26
  • root :to => "sites#index" ...just requesting the root url. All of the various assets like under public Commented Aug 18, 2011 at 20:06

1 Answer 1

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"

Sign up to request clarification or add additional context in comments.

4 Comments

Good suggestion. Unfortunately yes it returns content type text/css
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
Try using your browsers debugging function to trace network activities
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.