Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asset pipeline force js.erb recompiling

My js.erb files are not being regenerated even when I restart the development server. Is there a way for me to force the asset pipeline to regenerate all of the javascript assets every time I restart the server?

If I change the actual .js.erb source file then it recompiles fine, but the code pulls from the database, reading seeded data that could change between server restarts.

like image 776
spike Avatar asked Nov 19 '11 00:11

spike


1 Answers

Late call here, but having had this problem all over the place, and being REALLY annoyed by it, dug in a bit. Here's my solution:

On restarting your server, rm -rf tmp/cache/*

That will blow away the SCSS and other cached assets, and force a recompile.

You could run rake assets:clean instead if you prefer or are using Rake to restart your server.

Obviously, doing this slows server restart by a bit, but may be worth it for the removal of this major pain point...

like image 67
Irongaze.com Avatar answered Sep 29 '22 09:09

Irongaze.com