Rails Asset Pipeline-错误的指纹 [英] Rails Asset Pipeline - wrong fingerprint
问题描述
我的Rails 4应用程序具有new.html.erb
,它引用了form.html.erb
:
My Rails 4 application has new.html.erb
which has a reference to form.html.erb
:
# app/assets/templates/jobs/new.html.erb
...
<ng-include src="'<%= asset_path("jobs/form.html") %>'"></ng-include>
...
# app/assets/templates/jobs/form.html.erb
my form is here
( ng-include
是问题是,当form.html.erb
更改时,生产环境仍会加载旧的form.html.erb
.发生这种情况的原因可能是new.html.erb
未被更改,因此具有相同的旧指纹,该指纹指向具有旧指纹的form.html.erb
.
The problem is, that when form.html.erb
changes, the production environment still loads the old form.html.erb
. This is happening probably because new.html.erb
hasn't been changed, and therefore has the same old fingerprint, which points to form.html.erb
with the old fingerprint.
Rails处理此问题的方法是什么?
What is the Rails way to handle this?
推荐答案
要解决此问题,万一其他人遇到问题,您需要运行以下命令:
To answer this, in-case anyone else has the issue, you need to run the following:
rake assets:clean
rake assets:precompile
touch tmp/restart.txt
运行rake任务后,需要重新启动Rack,否则将不会加载新的预编译资产文件.
After running the rake task, you need to restart Rack, otherwise the new precompiled assest files will not be loaded.
这篇关于Rails Asset Pipeline-错误的指纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!