I'm working on a Rails app with a high number of assets, which sadly cannot be reduced. In production this is not a problem, but in development, ~20 asset requests per visited page cannot be quickly served by an application server (like webrick or Thin).
So I started using nginx in development for serving anything in public/assets
. Note that nginx is purely a development facility - we don't intend to use it in production.
For it to work I just had to do two things:
- Set
config.assets.debug
to false - run
rake assets:precompile
Sadly there are two problems (the latter being the most important one) with my setup:
- Every assets change requires manually running
rake assets:precompile
again - For the app server to pick up the newly-compiled assets, I have to restart it.
What is a correct nginx / Asset Pipeline setup which does not require a Rails server restart after precompilation?
Automatic compilation would also be welcome.
rake assets:precompile
and restart your server. – max