当前位置:  开发笔记 > 编程语言 > 正文

由gem生成的沉默弃用警告

如何解决《由gem生成的沉默弃用警告》经验,为你挑选了1个好方法。

我在我的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  at /home/rhl/myapp/config/application.rb:8)
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from  at /home/rhl/myapp/config/application.rb:8)
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from  at /home/rhl/myapp/config/application.rb:8)

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

我试过添加:

config.active_support.deprecation = :silence

production.rb

但它不起作用.



1> 小智..:

ActiveSupport::Deprecation.silenced = true

推荐阅读
mobiledu2402851373
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有