Jenkins从站与本地终端使用的Ruby版本不同

问题描述 投票:3回答:1

我正在使用OSX Jenkins从站来为Xcode运行一些构建命令。当我在本地终端中运行gem环境时,这就是我得到的。

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.8
  - RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-darwin15]
  - INSTALLATION DIRECTORY: /Users/nvitas/.rvm/gems/ruby-2.2.0
  - RUBY EXECUTABLE: /Users/nvitas/.rvm/rubies/ruby-2.2.0/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/nvitas/.rvm/gems/ruby-2.2.0/bin
  - SPEC CACHE DIRECTORY: /Users/nvitas/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/nvitas/.rvm/rubies/ruby-2.2.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-15
  - GEM PATHS:
     - /Users/nvitas/.rvm/gems/ruby-2.2.0
     - /Users/nvitas/.rvm/gems/ruby-2.2.0@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/nvitas/.rvm/gems/ruby-2.2.0/bin
     - /Users/nvitas/.rvm/gems/ruby-2.2.0@global/bin
     - /Users/nvitas/.rvm/rubies/ruby-2.2.0/bin
     - /Users/nvitas/.rvm/bin
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin

这是我期望的。现在,当我通过詹金斯运行完全相同的命令时,我得到此

RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.14
  - RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [universal.x86_64-darwin15]
  - INSTALLATION DIRECTORY: /Users/nvitas/.rvm/gems/ruby-1.9.2-p320
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/nvitas/.rvm/gems/ruby-1.9.2-p320/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-15
  - GEM PATHS:
     - /Users/nvitas/.rvm/gems/ruby-1.9.2-p320
     - /Users/nvitas/.rvm/gems/ruby-1.9.2-p320@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/

我在同一目录,同一用户中运行所有内容,没有什么不同,所以为什么ruby版本和目录出错?我的詹金斯奴隶中唯一的配置设置是PATH变量,其值是>>

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/nvitas/.rvm/gems/ruby-2.2.0/bin:/Users/nvitas/.rvm/bin:/Users/nvitas/.rvm/gems/ruby-2.2.0

除了安装的所有东西。

我正在使用OSX Jenkins从站来为Xcode运行一些构建命令。当我在本地终端中运行gem环境时,这就是我得到的。 RubyGems环境:-RUBYGEMS版本:2.4.8-RUBY ...

ruby macos jenkins gem
1个回答
0
投票

我有同样的问题,您能解决吗?

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