【问题标题】:Gem::InstallError: nokogiri requires Ruby version < 2.7.dev, >= 2.3 on PentestboxGem::InstallError: nokogiri 在 Pentestbox 上需要 Ruby 版本 < 2.7.dev, >= 2.3
【发布时间】:2019-06-29 20:55:45
【问题描述】:

当我尝试在 pentestbox 上一个版本上运行 metasploit 时,我收到以下错误

找不到 gem "activesupport" 的兼容版本:在快照 (Gemfile.lock) 中:activesupport (= 4.2.11) 在 Gemfile 中:metasploit-framework x86-mingw32 已解析为 5.0.5,这取决于 activerecord ( ~> 4.2.6) x86-mingw32 被解析为 4.2.10,这取决于 activesupport (= 4.2.10) x86-mingw32 rspec-rails x86-mingw32 被解析为 3.8.2,这取决于 railties (>= 3.0 ) 已解析为 4.2.11,这取决于 activesupport (= 4.2.11) x86-mingw32 运行 bundle update 将仅使用 Gemfile 中的 gem 从头开始​​重建您的快照,这可能会解决冲突。

我尝试运行命令“bundle update”,但收到此错误

获取 nokogiri 1.10.1 (x86-mingw32) 安装 nokogiri 1.10.1 (x86-mingw32) Gem::InstallError: nokogiri 需要 Ruby 版本 = 2.3。安装 nokogiri (1.10.1) 时出错,Bundler 无法继续。在捆绑之前确保gem install nokogiri -v '1.10.1'成功

之后我尝试运行命令“bundle install”我得到同样的错误

【问题讨论】:

  • 你有什么版本的 Ruby?
  • ruby 2.2.6p396(2016-11-15 修订版 56800)[i386-mingw32]

标签: ruby metasploit


【解决方案1】:

我在 Windows 10 中也遇到了同样的错误,我能够成功安装 nokogori。下面是我的 Ruby 环境。

RubyGems Environment:
      - RUBYGEMS VERSION: 2.4.5
      - RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x64-mingw32]
      - INSTALLATION DIRECTORY: C:/Ruby222-x64/lib/ruby/gems/2.2.0
      - RUBY EXECUTABLE: C:/Ruby222-x64/bin/ruby.exe
      - EXECUTABLE DIRECTORY: C:/Ruby222-x64/bin
      - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
      - RUBYGEMS PLATFORMS:
        - ruby
        - x64-mingw32
      - GEM PATHS:
         - C:/Ruby222-x64/lib/ruby/gems/2.2.0

为了解决这个问题,我刚刚更新了我的 Gemfile。我添加了这一行: gem 'nokogiri', '~> 1.6.8'

【讨论】:

    【解决方案2】:

    我使用的是 Windows 10,我安装了已修复此问题的 nokogiri 预发布版本。

    gem inst nokogiri --pre
    

    然后我更改了gemfile.lock文件中的依赖:

    nokogiri (1.11.0.rc2-x64-mingw32)
    

    参考:
    https://github.com/sparklemotion/nokogiri/issues/1961

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-03
      • 2020-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-05
      相关资源
      最近更新 更多