How to clear Sprockets cache?

耗尽温柔 提交于 2019-11-30 14:31:04

问题


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.


回答1:


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




回答2:


In my case, the following command worked:

rake tmp:clear



回答3:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!