[英]Error installing Rails 6.0.2.2 with Ruby 2.7.0.0 - The last version of nokogiri (>= 1.6) to support your Ruby & RubyGems was 1.10.9
I am on Windows and running Ruby 2.7.0.我在 Windows 上运行 Ruby 2.7.0。
When running gem install rails
I get this error:运行
gem install rails
此错误:
ERROR: Error installing rails:
The last version of nokogiri (>= 1.6) to support your Ruby & RubyGems was 1.10.9.
Try installing it with `gem install nokogiri -v 1.10.9` and then running the current command again
nokogiri requires Ruby version >= 2.3, < 2.7.dev. The current ruby version is 2.7.0.0.
When I run gem install nokogiri -v '1.10.9'
I get the same exact error.当我运行
gem install nokogiri -v '1.10.9'
我得到了完全相同的错误。
I have installed gem install nokogiri -v 1.11.0.rc1 --pre
, but I'm still getting the same errors.我已经安装
gem install nokogiri -v 1.11.0.rc1 --pre
,但我仍然遇到相同的错误。
$ nokogiri -v
# Nokogiri (1.11.0.rc1)
---
warnings: []
nokogiri: 1.11.0.rc1
ruby:
version: 2.7.0
platform: x64-mingw32
description: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
engine: ruby
libxml:
source: packaged
patches:
- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
- 0002-Remove-script-macro-support.patch
- 0003-Update-entities-to-remove-handling-of-ssi.patch
- 0004-libxml2.la-is-in-top_builddir.patch
compiled: 2.9.10
loaded: 2.9.10
libxslt:
source: packaged
patches: []
compiled: 1.1.34
loaded: 1.1.34
So, I understand that Ruby 2.7.0 is later than 2.7.dev, but I have the nokogiri gem installed.所以,我知道 Ruby 2.7.0 晚于 2.7.dev,但我安装了 nokogiri gem。
Also, everything was working fine with Ruby 2.6.5.此外,Ruby 2.6.5 一切正常。 I did uninstall it, remove it from the Path, and restart my machine.
我确实卸载了它,从路径中删除它,然后重新启动我的机器。
If anybody has any ideas I would love to hear them.如果有人有任何想法,我很乐意听取他们的意见。
It seems that when you are trying to install nokogiri
it installs a version which is not compatible with your ruby version and shows that error.似乎当您尝试安装
nokogiri
它会安装一个与您的 ruby 版本不兼容的版本并显示该错误。
Even when you specify the version to install, it'll ignore the version number specified and install the latest one as shown in your error.即使您指定要安装的版本,它也会忽略指定的版本号并安装最新的版本,如错误所示。
$ nokogiri -v
# Nokogiri (1.11.0.rc1)
---
warnings: []
nokogiri: 1.11.0.rc1
So try to make the gem makes the download itself for the currently installed ruby version.因此,请尝试让 gem 自行下载当前安装的 ruby 版本。
gem install nokogiri --platform=ruby
PS This could take a while... PS 这可能需要一段时间...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.