【问题标题】:Rails Asset Pipeline - wrong fingerprintRails 资产管道 - 指纹错误
【发布时间】:2013-07-20 14:15:05
【问题描述】:

我的 Rails 4 应用程序有 new.html.erb,它引用了 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-includeAngularJS 指令)

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

Rails 的处理方式是什么?

【问题讨论】:

    标签: ruby-on-rails asset-pipeline ruby-on-rails-4


    【解决方案1】:

    要回答这个问题,万一其他人有问题,您需要运行以下命令:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-23
      • 1970-01-01
      • 2023-03-31
      相关资源
      最近更新 更多