简体   繁体   English

使用 Ruby 2.7.0.0 安装 Rails 6.0.2.2 时出错 - 支持 Ruby 和 RubyGems 的最新版本 nokogiri (>= 1.6) 是 1.10.9

[英]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.

相关问题 安装rails时出错:nokogiri需要Ruby版本<2.4,> = 2.1.0 - Error Installing rails: nokogiri requires Ruby version < 2.4, >= 2.1.0 在Ruby on Rails应用程序中安装“ nokogiri”时出错? - Error installing “nokogiri” in a Ruby on Rails application? 如何使用 jQuery hover() 方法 Ruby on Rails 6.0.2.2 版本 - How to use jQuery hover() Method for Ruby on Rails 6.0.2.2 version 在Ubuntu上安装Ruby / Rubygems错误 - Installing Ruby/Rubygems error @ Ubuntu nokogiri错误与在轨道上的红宝石? - nokogiri error with ruby on rails? Ruby on Rails:RVM和Rubygems错误 - Ruby on Rails : RVM and Rubygems Error Ruby版本-安装Rails时出错 - Ruby version - Error installing Rails 如何将 Rails 项目上的大型 Ruby 从 Rails 版本 4.2.2 升级到 6.0.2.2? - How to upgrade big Ruby on Rails project from Rails version 4.2.2 to 6.0.2.2? 使用RVM在ruby 2.2.0上安装rails 4.2生成“你的Ruby版本是2.2.0,但你的Gemfile指定为2.1.5” - installing rails 4.2 on ruby 2.2.0 using RVM generates “Your Ruby version is 2.2.0, but your Gemfile specified 2.1.5” Mysql2::Error: # MySQL 客户端未连接 — Rails 6.0.2.2 with rspec; Ruby 2.6.4 mac os Catalina + Mojave - Mysql2::Error: # MySQL client is not connected — Rails 6.0.2.2 with rspec; Ruby 2.6.4 mac os Catalina + Mojave
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM