我在运行tail -f production.log时注意到了这一点。这里有更深入的内容:

Processing by Spree::Admin::ProductsController#edit as HTML
  Parameters: {"id"=>"1"}
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/shared/_product_sub_menu.html.erb (8.5ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/shared/_product_tabs.html.erb (8.3ms)
  Rendered spree/shared/_error_messages.html.erb (0.3ms)
Deface: [WARNING] No :original defined for 'add_book_fields_to_admin_products_form', you should change its definition to include:
 :original => '123dfjdlkfjdjflsdjf123'
Deface: [WARNING] No :original defined for 'insert_bottom_admin_product_form_right', you should change its definition to include:
 :original => '123dfjdlkfjdjflsdjf123'
Deface: [WARNING] No :original defined for 'add_custom_price_multiplier_field_to_admin_product_edit', you should change its definition to include:
 :original => '123dfjdlkfjdjflsdjf123'
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/products/_form.html.erb (69.5ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/shared/_edit_resource_links.html.erb (1.8ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/products/edit.html.erb within spree/layouts/admin (489.8ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/shared/_translations.html.erb (2.6ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/core/app/views/spree/shared/_routes.html.erb (0.4ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/shared/_routes.html.erb (3.5ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/shared/_head.html.erb (9.3ms)
  Rendered /data/site/shared/bundled_gems/ruby/1.9.1/bundler/gems/spree-9c3a61024d8c/backend/app/views/spree/admin/shared/_alert.html.erb (0.0ms)
  Rendered spree/admin/shared/_tabs.html.erb (321.5ms)

123dfjdlkfjdjflsdjf123过去是一个很长的散列。出于安全考虑,我已经把它们全部搬走了。我正在使用spree框架。我在他们的github和另一个SO问题上也发现了这个错误。
如果有人能告诉我这里发生了什么事,我很想摆脱这些警告。如果有人能告诉我:original符号的作用以及它与spree的关联方式,我也会非常感激。

最佳答案

警告来自诽谤。deface为应用程序开发人员和扩展编写人员提供了修改现有模板以修改其内容的能力。
例如,可以用指定的内容替换foo中的所有内容。它非常强大,允许您以一种微创的方式轻松地更改spree的内容。
你有一个问题。如果在未来版本的spree中,有人删除foo会发生什么。那么你的内容将不会被插入到foo的位置,因为foo不存在。你的内容根本不会出现。
为了让开发人员了解这种情况发生的时间,deface计算它正在操作的模板的哈希值,并将其与您根据其开发的模板的预期哈希值进行比较。然后在将来,如果模板在spree版本升级过程中发生了变化,那么您应该查看正在重写的模板,并确保所有内容仍按预期工作。
这些警告可能来自一个扩展(在您的情况下,可能是spree_gift_card),该扩展的作者没有为它们覆盖的模板指定original。您可以向gem的作者提交一个问题,或者提交一个pull请求来添加它们。

关于ruby-on-rails - 否:在Ruby on Rails生产日志中显示了为“some_file”定义的原始信息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22625554/

10-13 07:09