由 gem 生成的静默弃用警告 [英] Silence deprecation warning generated from of a gem

查看:46
本文介绍了由 gem 生成的静默弃用警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Rails 5.0.0.1 应用程序中使用了 unscoped_associations gem.

I am using the unscoped_associations gem in my Rails 5.0.0.1 application.

我收到此弃用警告:

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, 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, 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)

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

How can I silence this warning in production environment?

我尝试添加:

config.active_support.deprecation = :silence

production.rb

但它不起作用.

推荐答案

ActiveSupport::Deprecation.silenced = true

这篇关于由 gem 生成的静默弃用警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆