I'm getting an error message that I can't find the solution for when I'm trying to install Rails v 6.1.1 on my new Mac machine (still on Catalina, not Big Sur)
I have rbenv and Homebrew installed and have updated to the latest version of Ruby (3.0.0). When I put out which ruby I get: /usr/local/opt/ruby/bin/ruby
Here's the error code I'm seeing in terminal when I run gem install rails -v 6.1.1 (same error with sudo install):
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/3.0.0/gems/mimemagic-0.3.10/ext/mimemagic
/usr/local/opt/ruby/bin/ruby -I/usr/local/lib/ruby/site_ruby/3.0.0 -rrubygems /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0/gems/rake-13.0.3/exe/rake RUBYARCHDIR\=/usr/local/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.10 RUBYLIBDIR\=/usr/local/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.10
rake aborted!
Could not find MIME type database in the following locations: ["/usr/local/share/mime/packages/freedesktop.org.xml", "/opt/homebrew/share/mime/packages/freedesktop.org.xml", "/opt/local/share/mime/packages/freedesktop.org.xml", "/usr/share/mime/packages/freedesktop.org.xml"]
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.
The FREEDESKTOP_PLACEHOLDER option is meant as a transitional feature, and will be deprecated in the next release.
/usr/local/lib/ruby/gems/3.0.0/gems/mimemagic-0.3.10/ext/mimemagic/Rakefile:15:in `locate_mime_database'
/usr/local/lib/ruby/gems/3.0.0/gems/mimemagic-0.3.10/ext/mimemagic/Rakefile:39:in `block in <top (required)>'
Tasks: TOP => default
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/3.0.0/gems/mimemagic-0.3.10 for inspection.
Results logged to /usr/local/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.10/gem_make.out