由于Ruby Gem错误,Jenkins构建作业失败

我们有Jenkins使用ruby脚本构建作业 . 我们想要一个gem(需要'net / ssh') . 这个宝石在通过Jenkins运行时失败了 . 但是在Jenkins Servers中运行时成功了 .

/usr/local/rvm/scripts/rubies/ruby-2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- net/ssh (LoadError) from /usr/local/rvm/scripts/rubies/ruby-2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require ' from /var/lib/jenkins/workspace/auto-sync/automation/jenkins/database_bkup/database_bk.rb:2:in `'构建步骤'Execute shell'将构建标记为失败

在本地宝石列表中

minitest(5.10.1)multipart-post(2.0.0)net-ssh(4.2.0)net-telnet(0.1.1)nokogiri(1.8.1)openssl(默认值:2.0.3)power_assert(0.4.1)心理(默认值:2.2.2)

RubyGems环境:

  • RUBYGEMS版本:2.6.11

  • RUBY VERSION:2.4.1(2017-03-22 patchlevel 111)[x86_64-linux]

  • 安装目录:/usr/local/rvm/scripts/gems/ruby-2.4.1

  • 用户安装目录:/var/lib/jenkins/.gem/ruby/2.4.0

  • RUBY EXECUTABLE:/usr/local/rvm/scripts/rubies/ruby-2.4.1/bin/ruby

  • 可执行目录:/usr/local/rvm/scripts/gems/ruby-2.4.1/bin

  • SPEC CACHE目录:/var/lib/jenkins/.gem/specs

  • SYSTEM CONFIGURATION目录:/ etc

  • RUBYGEMS PLATFORMS:

  • 红宝石

  • x86_64-linux

  • GEM路径:

  • /usr/local/rvm/scripts/gems/ruby-2.4.1

  • /usr/local/rvm/scripts/gems/ruby-2.4.1@global

  • 创业板配置:

  • :update_sources => true

  • :verbose => true

  • :backtrace => false

  • :bulk_threshold => 1000

  • 远程来源:

  • https://rubygems.org/

  • SHELL PATH:

  • /usr/local/rvm/scripts/gems/ruby-2.4.1/bin

  • /usr/local/rvm/scripts/gems/ruby-2.4.1@global/bin

  • /usr/local/rvm/scripts/rubies/ruby-2.4.1/bin

  • / usr / local / rvm / scripts / bin

  • /var/lib/jenkins/.sdkman/candidates/grails/current/bin

  • / usr / local / sbin

  • / usr / local / bin

  • / usr / sbin

  • / usr / bin

  • / sbin

  • / bin

  • / snap / bin

回答(0)