LoginSignup
1
0

More than 1 year has passed since last update.

Rails mimemagic問題でRails new . できないを解決

Last updated at Posted at 2022-03-09

はじめに

Rails 6系の環境を用意している際にmimemagic問題に遭遇した

環境

M1 Mac
VS code
Ruby 3.1.0
bundler 2.3.3

エラーコード

Ensure you have either installed the shared-mime-info package for your distribution, or
obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location
of that file.

This gem might be installed as a dependency of some bigger package, such as rails,
activestorage,
axlsx or cucumber. While most of these packages use the functionality of this gem, some gems
have
included this gem by accident. Set USE_FREEDESKTOP_PLACEHOLDER=true if you are certain that you
do not need this gem, and wish to skip the inclusion of freedesktop.org.xml.

# 重要なのは下記 mimemagicが曲者です
An error occurred while installing mimemagic (0.3.10), and Bundler cannot
continue.

エラーが起きる理由

このエラーはrails 6.0.3.4をinstallしようとした際に発生しました。
詳しいことは省きますが、mimemagicのライセンス問題で発生しています。
解決策は6.0.3.6をinstallすることです。

詳しく知りたい方はこちらを確認してください

一言で言うなればmimemagic問題を解決しているversionを使えばエラーは出なくなります。

おわりに

実は少し前にRuby on Rails チュートリアルを完走したのですが、チュートリアルの中でmimemagic問題で沼ってしまい1週間くらい無駄にした苦い経験があります。(tutorialではrails以外のgemも変更した)

今回遭遇した際は冷静に対処できました

1
0
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
1
0