我在ubuntu上安装了Jenkins作业。我尝试在bash shell中使用rvm,但它说我需要调用/ bin / bash --login才能使用shell脚本。所以我尝试将它添加到我的shell脚本的顶部,但它仍然失败。所以谷歌去了,为詹金斯找到了一个RVM插件。我为jruby 1.7.4配置了插件,但现在我收到了一个全新的错误:
Capturing environment variables produced by 'rvm use jruby-1.7.4'
$ bash -c export
$ bash -c "test -f ~/.rvm/scripts/rvm"
$ bash -c "test -f /usr/local/rvm/scripts/rvm"
[workspace] $ bash -c " source /usr/local/rvm/scripts/rvm && rvm use --install --create jruby-1.7.4 && export > rvm.env"
Using /usr/local/rvm/gems/jruby-1.7.4
[workspace] $ /bin/sh -xe /home/nwssc/apache-tomcat-7.0.40/temp/hudson661746741998327634.sh
+ export JRUBY_OPTS=--1.8
+ jruby -S cucumber
/home/nwssc/apache-tomcat-7.0.40/temp/hudson661746741998327634.sh: 3: /home/nwssc/apache-tomcat-7.0.40/temp/hudson661746741998327634.sh: jruby: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
那么在ubuntu上执行此操作的正确方法是什么?我已经在Windows上成功部署了它,但是RVM和Jenkins看起来并不好看。我需要拦截cucumber命令并导出JRUBY_OPTS = - 1.8。