【エラー】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.
原因
mimemagic
はrailsの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
を実行すると解決します。