如何用 ActiveSupport::LoggerSilence 替换 LoggerSilence?

Mis*_*scu 3 ruby-on-rails heroku

当我heroku run rake db:migrate在 Heroku 上运行 Rails 应用程序的迁移时,我收到以下弃用警告。它是如何固定的?

DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use `ActiveSupport::LoggerSilence` instead (called from <top (required)> at /app/config/application.rb:18)

然后heroku run rake db:seed我运行时也收到相同的警告:当我运行时再次heroku run rake db:examples

我有一点困惑是我有config/application.rb但它在项目的根目录中,而不是在 /app 目录中。我是否应该在app目录中创建另一个配置文件(如果是这样,该文件中有什么内容?)。谢谢!

小智 7

对我来说,我将问题追溯到rails_12factor- rails_stout_logging的依赖

显然不建议将其rails_12factor用于使用rails5+创建的应用程序,并且我运行的是 Rails 6 应用程序。

简单地删除rails12_factor为我解决了这个问题。