我正在尝试让 jenkins 在工作节点上运行,以便在 Ubuntu 14.04 上测试一些 Rails 项目。我已经安装了 RVM这些文档。当我从 Jenkins“主”启动构建时,节点构建的控制台输出产生以下输出。jenkins 用户的主目录包含一个从备份中复制的 .rvm 目录。肯定是较旧的 rvm 安装。这有关系吗?我不熟悉 rvm。
...
$ bash -c export
$ bash -c "test -f ~/.rvm/scripts/rvm"
$ bash -c "test -f ~/.rvm/scripts/rvm"
[PIMS] $ bash -c " source ~/.rvm/scripts/rvm && rvm use --install --create . && export > rvm.env"
Using /usr/share/rvm/gems/ruby-2.3.5
[PIMS] $ /bin/bash +x +e /tmp/jenkins1009584960163749179.sh
GemWrappers: Can not wrap missing file: bundle
GemWrappers: Can not wrap missing file: bundler
GemWrappers: Can not wrap missing file: rb2db
unable to convert "\xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb, skipping
unable to convert "\xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb, skipping
Successfully installed bundler-1.16.1
Successfully installed rb2db-0.2.2
2 gems installed
Installing ri documentation for bundler-1.16.1...
Installing ri documentation for rb2db-0.2.2...
Installing RDoc documentation for bundler-1.16.1...
Installing RDoc documentation for rb2db-0.2.2...
/tmp/jenkins1009584960163749179.sh: line 70: rvm: command not found
/tmp/jenkins1009584960163749179.sh: line 77: bundle: command not found
/tmp/jenkins1009584960163749179.sh: line 89: bundle: command not found
/tmp/jenkins1009584960163749179.sh: line 90: bundle: command not found
/usr/bin/xvfb-run: 184: /usr/bin/xvfb-run: bundle: not found
/tmp/jenkins1009584960163749179.sh: line 108: tmp/failures.log: No such file or directory
grep: tmp/failing_specs.log: No such file or directory
...
当我which
以 jenkins 用户身份从命令行运行时,这些命令显示正常。问题可能出在哪里?
$ echo $PATH
/usr/share/rvm/gems/ruby-2.3.5/bin:
/usr/share/rvm/gems/ruby-2.3.5@global/bin:
/usr/share/rvm/rubies/ruby-2.3.5/bin:/bin:/sbin:
/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:
/usr/lib/jvm/java-8-oracle/bin:
/usr/lib/jvm/java-8-oracle/db/bin:
/usr/lib/jvm/java-8-oracle/jre/bin:
/opt/instantclient_12_2:/usr/share/rvm/bin
[jenkins@node1 ~/workspace]
$ which rvm
/usr/share/rvm/bin/rvm
[jenkins@node1 ~/workspace]
$ which bundle
/usr/share/rvm/gems/ruby-2.3.5/bin/bundle
[jenkins@node1 ~/workspace]
$ which rb2db
/usr/share/rvm/gems/ruby-2.3.5/bin/rb2dnb
[jenkins@node1 ~/workspace]
$ which xvfb-run
/usr/bin/xvfb-run