Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to force generation of assets with Rails Asset Pipeline?

Tags:

Is there a way to force regeneration of assets every request when using the Rails 3.1 Asset Pipeline?

I am having problems getting the system to pick up changes to files when using Less (less-rails) with a series of partials and mixin files. If I could just force the system to generation on each request I would be much more productive.

like image 882
Toby Hede Avatar asked Oct 02 '11 06:10

Toby Hede


People also ask

How asset pipeline works in Rails?

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB. Prior to Rails 3.1 these features were added through third-party Ruby libraries such as Jammit and Sprockets.

How do you Precompile an asset?

To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.

What does rake assets Clean do?

The clean it removes the old versions of the precompiled assets while leaving the new assets in place. Show activity on this post. rake assets:clean removes compiled assets. It is run by cap deploy:assets:clean to remove compiled assets, generally from a remote server.


1 Answers

To force a complete regeneration of all assets use:

rake assets:clobber assets:precompile 

Very handy when asset_sync isn't playing fair with you...

I know this may not help you, but hopefully it will make it easier for someone else to find the answer.

like image 54
FuzzyJulz Avatar answered Sep 22 '22 08:09

FuzzyJulz