I am attempting to migrate our application to use the Asset Pipeline, so i have been testing my changes locally (using the built in Webrick server). My production.rb looks like this:
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
Note, the config.serve_static_assets = true
This works perfectly, in that i can run
rm -rf tmp
rm -rf public/assets
RAILS_ENV=production bundle exec rake assets:clean
RAILS_ENV=production bundle exec rake assets:precompile
rails server -p 3500 -e production
On my local machine and everything loads fine. However, now i want to push my changes to our production Apache server i want Apache to serve assets, so i set:
config.serve_static_assets = false
If i now try to load up a production rails server on my local box, the static assets do not load. I am not sure whether this is expected behaviour or not (i mean, i'm telling Rails not to serve me static assets and it isn't - but i want something to serve them to me).
So my question is, how can i have config.serve_static_assets = false
in my production.rb
while still being able to run local production rails servers? Is what i'm asking even possible or sensible?
Thanks
Note: using Rails 3.2.11