我想要在Windows10上安装ruby on rails,按照这个视频中的相同说明:https://www.youtube.com/watch?v=G-B_KUFNkQQ
当它完成ruby的安装后,我返回到控制台,在gem安装rails之后,我得到了这个错误:
C:\Users\Usuario>gem install rails --no-document
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.
    current directory: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mimemagic-0.3.9/ext/mimemagic
C:/Ruby27-x64/bin/ruby.exe -IC:/Ruby27-x64/lib/ruby/2.7.0/rubygems -rrubygems C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.1/exe/rake RUBYARCHDIR\=C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/mimemagic-0.3.9 RUBYLIBDIR\=C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/mimemagic-0.3.9
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-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.
Tasks: TOP => default
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mimemagic-0.3.9 for inspection.
Results logged to C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/mimemagic-0.3.9/gem_make.out我试图解决进行更新和"gem install mime-types-data“的问题,但仍然存在同样的问题……
Ruby安装程序是Ruby2.7.2-1 (x64),我的ruby版本是Ruby2.7.2p137 (2020-10-01修订版5445e04352) x64-mingw32
发布于 2021-04-30 17:18:03
Windows10 ruby 2.6.2安装rails 6.0.0.rc1
刷新
发布于 2021-04-02 14:37:05
我从https://gitlab.freedesktop.org/xdg/shared-mime-info/下载了软件包,然后将环境变量(Windows) FREEDESKTOP_MIME_TYPES_PATH设置为该路径("c:....\data\freedesktop.org.xml.in")。
我还安装了mime-types-data > gem install mime-types-data
起初,在关闭并再次打开终端后,它无法正常工作。
提示:如果您使用vscode,则需要重新打开vscode
如果您使用的是macOS,请尝试以下操作
brew install shared-mime-info
bundle update mimemagic
发布于 2021-03-27 00:50:36
问题是,模拟团队昨天修改了很多版本,现在你必须在你的发行版中安装https://rubygems.org/gems/mimemagic/versions -mime-info包。
我建议在windows中使用WSL进行rails开发,这将在未来省去很多问题。
https://stackoverflow.com/questions/66808927
复制相似问题