Rails 错误无法找到 freedesktop.org.xml [英] Rails Error Can't Find freedesktop.org.xml

查看:34
本文介绍了Rails 错误无法找到 freedesktop.org.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开始一个新的 RAILS 项目时遇到了一些问题,我收到一个错误,提示缺少文件 /usr/local/share/mime/packages/freedesktop.org.xml.与 mimemagic 依赖项有联系,我在 GitHub 上发现了有关 mimemagic 版本和许可的问题 - https://github.com/rails/rails/issues/41750

I've had some issues starting a new RAILS project, where I'm getting an error that there is a missing file /usr/local/share/mime/packages/freedesktop.org.xml. There was a connection with the mimemagic dependencies, and I found this issue on GitHub about the mimemagic version and licensing - https://github.com/rails/rails/issues/41750

想知道是否有其他人遇到过这个问题,并且可以解释发生了什么.

Wondering if anybody else ran into the issue, and could explain what is going on.

我使用 rbenv 和 ruby​​ 版本:3.0.0p0(2020-12-25 修订版 95aff21468)[x86_64-darwin19] 和 rails 6.1.3

I'm using rbenv with ruby version: 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19], and rails 6.1.3

这是命令行中的错误信息:

Here is the error message in the command line:

Installing railties 6.1.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mimemagic-0.3.7/ext/mimemagic
/Users/nico/.rbenv/versions/3.0.0/bin/ruby -I/Users/nico/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -rrubygems
/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/exe/rake
RUBYARCHDIR\=/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.7
RUBYLIBDIR\=/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.7
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", "/usr/share/mime/packages/freedesktop.org.xml"]

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

Tasks: TOP => default
(See full trace by running task with --trace)

rake failed, exit code 1

谢谢,妮可

推荐答案

在我发布的 GitHub 链接上找到了一些指向 shared-mime-info 的链接,我通过运行以下命令并启动一个新项目解决了该问题:

Found some links to shared-mime-info on the GitHub link I posted, and I solved the issue by running the command below and starting a new project:

brew install shared-mime-info

这篇关于Rails 错误无法找到 freedesktop.org.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆