Closed dbarros closed 14 years ago
Never mind. Minutes after posting the question (although I had tried to find a solution for quite a while), by chance I came across the solution.
For anyone interested, I needed to set the following in config/environments/production.rb:
config.serve_static_assets = true
dbarros: Glad you got it solved, but -- yikes! Are static assets not served by default in Rails 3?
jashkenas: That's right. Seems like the default is to not serve static assets. This is from config/environments/production.rb:
config.serve_static_assets = false
FYI, I've pushed a new version of Jammit, and added a warning about Rails 3 and serve_static_assets
to the documentation.
Excellent! Hopefully it may help others faced with this "quirk". Thanks.
I have a Rails 3 app, running under Mongrel. When in development, all works as expected. Each CSS and JS file included individually.
But in production, the CSS and JS files are being concatenated and compressed every time I go to a URL in the Rails app.
The following happens when I hit the root URL. If I go to the URL twice, the following appears twice. As you can see, the main.css and main.js files are being generated every time:
This is my assets.yml file:
Is there something I need to do so that (in production) the main.css and main.js files are generated once?
Has this maybe have something to do with me using Mongrel and not Apache/Nginx: where I would set the HTTP Expires header information as prescribed in the Jammit docs?
Any help would be appreciated.
Thanks.