如何解决在Windows上安装Nokogiri for Rails的冲突要求

问题描述 投票:0回答:2

最近从Mac切换到PC,然后用bundle install撞墙。

我收到一个错误,但是我很难弄清楚这意味着什么以及如何解决它。我搜索了GitHub问题和其他StackOverflow线程,但这些修复建议都没有帮助我,因为它们主要集中在Linux上。

Bundler found conflicting requirements for the Ruby  version:
  In Gemfile:
    Ruby  (~> 2.6.5.0)

    pg was resolved to 0.21.0, which depends on
      Ruby  (< 2.5) x64-mingw32

Ruby  (< 2.5), which is required by gem 'nokogiri (>= 1.4.1)', is not available
in the local ruby installation
ruby-on-rails ruby install bundler nokogiri
2个回答
0
投票

您的Ruby版本对于该项目来说太新了。降级为Ruby 2.4.X或更新Gemfile的gem。


0
投票

我删除了解决此问题的Gemfile.lock文件。

Ruby版本在项目级别上很好,我知道这一点,因为服务器在Mac上运行,因此是Windows或计算机专有的问题。

© www.soinside.com 2019 - 2024. All rights reserved.