ruby-on-rails – 从gem生成的Silence弃用警告

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 从gem生成的Silence弃用警告前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我的Rails 5.0.0.1应用程序中使用 unscoped_associations gem.

我收到这个弃用警告:

DEPRECATION WARNING: alias_method_chain is deprecated. Please,use Module#prepend instead. From module,you can access the original method using super. (called from <top (required)> at /home/rhl/myapp/config/application.rb:8)
DEPRECATION WARNING: alias_method_chain is deprecated. Please,you can access the original method using super. (called from <top (required)> at /home/rhl/myapp/config/application.rb:8)

如何在生产环境中消除此警告?

我试过添加

config.active_support.deprecation = :silence

在production.rb

但它不起作用.

解决方法

ActiveSupport :: Deprecation.silenced = true
原文链接:https://www.f2er.com/ruby/267199.html

猜你在找的Ruby相关文章