Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear Sprockets cache?

Tags:

sprockets

When a Sprockets object compilation fails (due to a syntax error in CoffeeScript or SASS), it cannot recompile after the error is fixed because it says "file is already required."

In order to get the Sprockets object to work, I have to destroy and re-create it. I was wondering if anyone knew if there was a way to tell the Sprocket object to internally reset itself as to not run into this issue.

like image 387
kidcapital Avatar asked Feb 12 '12 05:02

kidcapital


3 Answers

rake tmp:cache:clear deletes the temporary cache directory.

like image 52
Ross Allen Avatar answered Oct 23 '22 20:10

Ross Allen


In my case, the following command worked:

rake tmp:clear
like image 9
Zorayr Avatar answered Oct 23 '22 19:10

Zorayr


It should be:

Rails.application.assets.cache.clear

but this method only in master branch and not even in beta.

Update: added in 4.0.0.beta5.

like image 2
Artem P Avatar answered Oct 23 '22 20:10

Artem P