我想在Windows 10上安装Ruby on Rails,按照这个视频的相同指示操作:https://www.youtube.com/watch?v=G-B_KUFNkQQ
安装Ruby完成后,我回到控制台,在运行gem install 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安装器是Ruby+Devkit 2.7.2-1(x64),我的ruby版本是ruby 2.7.2p137(2020年10月01日修订版5445e04352)[x64-mingw32]