Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need precompile assets every time I've made any change to see difference in browser

Like as I mentioned in title - I have to precompile assets every time I've made any change to see how it looks like - I've tried config.assets.compile = true, without success.

I've also tried RAILS_ENV = 'development' but with same effect. Please help me because it is really annoying.

My system is running on:

  • Xubuntu
  • Rails -v: 3.1.1
  • Ruby -v: 1.9.2p290

I also tried:

config.action_controller.perform_caching = true
like image 725
lukaszkups Avatar asked Nov 29 '11 13:11

lukaszkups


People also ask

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.

What is Require_tree?

The require_tree directive tells Sprockets to recursively include all JavaScript files in the specified directory into the output. These paths must be specified relative to the manifest file.


1 Answers

One cause of this could be that you ran rake assets:precompile once. The server then uses public/assets exclusively, without trying to compile your assets on the fly.

Try removing the public/assets directory.

like image 119
Benoit Garret Avatar answered Sep 26 '22 15:09

Benoit Garret