Need to ignore tmp/cache when precompiling locally #3014

rhulse opened this Issue Sep 14, 2011 · 0 comments


None yet
2 participants

rhulse commented Sep 14, 2011

I changed compressors to Google Closure to get around issue #2537 with uglifier reordering my files.

I tested the precompilation on my development machine. Rails forces env to production in this case.

After precompiling the generated JS did not reflect the change in compressor.

It appear that Sprockets is using the cache in tmp during static compilation instead of what is in the config and assets folder. On a dev machine tmp this is unlikely to be cleared out; in production (with Capistrano) you get a new tmp folder with each deploy.

On a local dev machine this could create issues for people who have to precompile locally if they change compressors (or some other change that the cache will ignore).

Anyway, it doesn't seem like a good idea to use the cache if it exists when precompiling - it will cause unexpected results, which in my case has wasted 2 hours this morning.

A config change (such as changing the compressor) should Just Work.


@josevalim josevalim closed this in 63f6fad Sep 14, 2011

gberenfield pushed a commit to gberenfield/rails that referenced this issue Sep 14, 2011

Merge pull request #3015 from guilleiguaran/clear-tmp-cache-on-precom…

Clear cache before of each precompile to avoid inconsistencies. Fixes #3014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment