【エラー】Your bundle is locked to mimemagic (0.3.4)....の対処法

はじめに

bundle install実行時に下記のエラーに遭遇したのでその対処法。

Your bundle is locked to mimemagic (0.3.4),
but that version could not be found in any of
the sources listed in your Gemfile. If you
haven't changed sources, that means the
author of mimemagic (0.3.4) has removed it.
You'll need to update your bundle to a
version other than mimemagic (0.3.4) that
hasn't been removed in order to install.

原因

mimemagicrailsのactivestorageが依存しているGemなのですが、どうやらライセンス問題(?)などで、一部使えなくなってしまったそうです。

解決法

解決法としてはRails 5.2.5 / 6.0.3.6 / 6.1.3.1にアップデートすれば問題ないようです。

mimemagicに依存しなくなったため。

railsのバージョンを変えたくない場合

  • 下記コマンドでshared-mime-infoをインストール
$ brew install shared-mime-info
  • gemfileにgem "mimemagic", "~> 0.3.10"を追加して、bundle update mimemagicを実行すると解決します。