hashdiff に関する警告が出たので修正する
Ruby Ruby on Rails
Published: 2019-06-08

やったこと

WebMock をインストールしたら、hashdiff に関する警告が出るようになったので修正します。

エラーで止まるわけではないので、ワーニングのようです。

確認環境

$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin17]

$ rails --version
Rails 5.2.3

調査

メッセージ

The HashDiff constant used by this gem conflicts with another gem of a similar name.  As of version 1.0 the HashDiff constant will be completely removed and replaced by Hashdiff.  For more information see https://github.com/liufengyun/hashdiff/issues/45
  • 定数で似ているものが使われている
  • HashDiff -> Hashdiff に置き換えられる

修正

メッセージのリンクを辿ると、下記に解決策がありました。

Conflicts with hash_diff · Issue #45 · liufengyun/hashdiff

Gemfile

gem 'hashdiff', ['>= 1.0.0.beta1', '< 2.0.0']

$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
You have requested:
  hashdiff >= 1.0.0.beta1, < 2.0.0

The bundle currently has hashdiff locked at 0.4.0.
Try running `bundle update hashdiff`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`

update してみます

$ bundle update

(これで該当の警告は出なくなりましたが、新しい警告が出るようになりました。)

参考