Sam*_*iki 2 ruby windows rubygems ruby-on-rails
I wanted to install ruby on rails for windows 10, following the same instructions of this video: https://www.youtube.com/watch?v=G-B_KUFNkQQ
When it finish the installation of ruby, I return to the console and after gem install rails, I get this error:
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
Run Code Online (Sandbox Code Playgroud)
I tried to solve making an update and "gem install mime-types-data" but stills with the same problem...
The Ruby Installer is Ruby+Devkit 2.7.2-1 (x64) and my ruby version is ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32]
我从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
小智 5
Windows 10 ruby 2.6.2 安装导轨 6.0.0.rc1
刷新环境
经过快速谷歌搜索后,这似乎是合适的:
此过程也适用于 Windows 计算机。
从https://packages.debian.org/sid/amd64/shared-mime-info/download下载软件包
确保安装了 7-Zip 的命令行版本
7z x -so shared-mime-info_2.0-1_amd64.deb data.tar | 7z e -sidata.tar "./usr/share/mime/packages/freedesktop.org.xml"将文件 freedesktop.org.xml 放置在适当的位置,然后将环境变量 FREEDESKTOP_MIME_TYPES_PATH 设置为该路径。
完成后,gem 应该会成功安装。
请注意,gem 将取决于运行时保留在该位置的文件。
| 归档时间: |
|
| 查看次数: |
1139 次 |
| 最近记录: |