Rails Asset Pipeline – 错误的指纹

我的Rails 4应用程序有new.html.erb ,它引用了form.html.erb

 # app/assets/templates/jobs/new.html.erb ... <ng-include src="''"> ... # app/assets/templates/jobs/form.html.erb my form is here 

ng-include是AngularJS指令)

问题是,当form.html.erb更改时,生产环境仍会加载旧的form.html.erb 。 发生这种情况可能是因为new.html.erb尚未更改,因此具有相同的旧指纹,指向带有旧指纹的form.html.erb

Rails处理这个问题的方法是什么?

要回答这个问题,如果其他人遇到此问题,您需要运行以下命令:

 rake assets:clean rake assets:precompile touch tmp/restart.txt 

运行rake任务后,需要重新启动Rack,否则将不会加载新的预编译的assest文件。