5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cannot load such file -- mimemagic/overlay (LoadError)

5
Last updated at Posted at 2021-03-30

mimemagicの関係でrails sができなくなった

上記のエラーでアプリが動かせなくなってしまった。mimemagic?

解決の流れ

mimemagic (0.3.5) ライセンスが取り下げられてエラーが出ている模様?

updateしてみる
mimemagic (0.4.3)が入るがエラーはそのまま変わらず

CarrierWaveが関係しているmimemagicの4系ではなく3系なら良いらしい
mimemagic (0.3.6)をGemfileに記載してbundle installで解決できた。
(参考mimemagicの最新動向より抜粋:CarrierWaveには現時点で0.4系では削除されているoverlay.rbに依存しているコードがあるため、強制的に0.3系を指定する必要がある。)

試したこと

エラー文を検索したが同じエラー内容はあまりヒットせず。似た感じの内容を試してみた。キャッシュを消したり、shared-mime-info をインストールしてから bundle update mimemagic する(参考mimemagicの最新動向)でも同じエラーで変わらなかった。
数日経つと同じエラーの記事を発見。
みんな(0.3.6)~(0.3.9)のあたりにしたという記事が多くなってきた自分のGemfileをみると mimemagic (0.4.3)とある。アップデートしすぎた?

学んだこと

・Gemのコマンドがたくさんあった(URL)。もっと使って行きたい
・バージョン上げたり下げたりして良い勉強になった。
・Gem同士の依存関係の意識がついた。

参考リンク

https://github.com/rails/rails/issues/41757
https://stackoverflow.com/questions/66837647/heroku-loaderror-cannot-load-such-file-mimemagic-overlay

おわり

リアルタイムの問題だったらしく情報が少ない中で試行錯誤するのは今の知識量では計り知れないと思いました。もっとスマートに解決できるようになりたい。

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?