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.
rake tmp:cache:clear
deletes the temporary cache directory.
In my case, the following command worked:
rake tmp:clear
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.
来源:https://stackoverflow.com/questions/9246585/how-to-clear-sprockets-cache