已安装Nokogiri 1.6.8,但在运行“捆绑安装”时给出了先前Nokogiri的错误

时间:2019-06-23 23:59:45

标签: ruby-on-rails ruby rubygems nokogiri redmine

我们关闭了服务器,Redmine停止了工作,因此我不得不重新安装Bundler并运行bundle install

运行bundle install时出现此错误:

c:\APPS\webapps\redmine-3.2.0>bundle install
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Using rake 12.3.2
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Using json 1.8.6
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 4.2.5
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.4.0
Fetching nokogiri 1.9.1 (x64-mingw32)
Installing nokogiri 1.9.1 (x64-mingw32)
Gem::RuntimeRequirementNotMetError: nokogiri requires Ruby version >= 2.2, <
2.6. The current ruby version is 2.0.0.
An error occurred while installing nokogiri (1.9.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.9.1' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rails was resolved to 4.2.5, which depends on
    actionmailer was resolved to 4.2.5, which depends on
      actionpack was resolved to 4.2.5, which depends on
        actionview was resolved to 4.2.5, which depends on
          rails-dom-testing was resolved to 1.0.9, which depends on
            nokogiri

我已经安装了Nokogiri 1.6.8。我不确定为什么它不能读取我安装的Nokogiri版本并仍然获取1.9.1,因为我需要Redmine 2.3.0的Ruby v.2,但是我的捆绑包仍然告诉我它正在寻找1.9.1。在进行bundle install时,我尝试根据自己的研究将Gemfile更改为gem "nokogiri", ">= 1.4.2",但是1.9.1仍然存在。如何成功升级Nokogiri?

我用过:

gem "nokogiri", "1.6.8"

在我的Gemfile中,我有:

c:\APPS\webapps\redmine-3.2.0>bundle update nokogiri
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Bundler could not find compatible versions for gem "nokogiri":
  In Gemfile:
    nokogiri (= 1.6.8) java

    roadie-rails java was resolved to 1.2.0, which depends on
      roadie (~> 3.1) java was resolved to 3.5.0, which depends on
        nokogiri (~> 1.8) java

如果我运行gem install nokogiri -v '1.9.1',我会得到一个错误,我的Ruby版本低于预期,并且我不能拥有更高的Ruby版本,因为Redmine是旧版本。

以下是我拥有的所有Nokogiri版本:

c:\APPS\webapps\redmine-3.2.0>gem uninstall nokogiri
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).

    Select gem to uninstall:
    1. nokogiri-1.6.8.rc3-x64-mingw32
    2. nokogiri-1.6.8-x64-mingw32
    3. nokogiri-1.6.8.1-x64-mingw32
    4. All versions

1 个答案:

答案 0 :(得分:0)

我无法解决此问题。它在升级和降级之间循环,因此在无奈之后我尝试了Ruby 2.6,Redmine 4.2声称是兼容的,但仍然有问题。我降级到Ruby 2.3并运行了,然后根据redmine.org文档迁移了数据库,几乎所有功能都正常运行,并且得到的反馈是它的速度要快得多。

根据我的经验,您将继续使用Redmine数据库,因此请不要担心它是同一版本。