Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

272
Visualizações
Can't Install Rails on Mac OS Catalina

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
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Just install shared-mime-info on your computer. From the docs of the mimemagic gem

You will require a copy of the Freedesktop.org shared-mime-info database to be available. If you're on Linux, it's probably available via your package manager, and will probably be in the location it's being looked for when the gem is installed.

macOS users can install the database via Homebrew with
brew install shared-mime-info.

Should you be unable to use a package manager you can obtain a copy of the needed file by extracting it from the Debian package. This process will also work on a Windows machine. [...]

Or

you might want to consider installing Rails 6.1.3.1 (instead of 6.1.1 in your command). That version was released to fix exactly the mimemagic issue that you are facing – just a couple of hours ago.

over 4 years ago · Santiago Trujillo Relatório

0

If you want to have brew install this for you and you haven't updated brew in a while, I would recommend running:

HOMEBREW_NO_AUTO_UPDATE=1 brew install shared-mime-info

I ran just

brew install shared-mime-info

And it updated a bunch of packages I didn't want it to and broke my ruby installation.

I like spickermann's solution too. It seems to be what the package maintainers want you to do.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda