LoginSignup
9
6

More than 5 years have passed since last update.

Rails5にアップグレードしてたくさん出てくるDEPRECATION WARNINGを非表示にする

Posted at

Rails5がリリースされましたね。アップグレードしてサーバーを起動するとalias_method_chainの非推奨についての警告が大量に表示されました。

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 /myapp/config/application.rb:7)

まだRails5に対応前のgemが多いようなので警告を非表示にします。非表示にするには警告が表示される前に ActiveSupport::Deprecation.silenced を指定します。

config/application.rb
require_relative 'boot'

require 'rails/all'
#
# Rails5に対応前のgemからの警告が多いのでサイレントにします。
#
ActiveSupport::Deprecation.silenced = true

すっきり。

このalias_method_chainへ対処するPullRequestを多く見かけたのでRails5に対応されるのをしばらく待ちましょう。

9
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
6