RVM 和 Jenkins 设置 [英] RVM and Jenkins setup
问题描述
我是 Jenkins CI 的新手.我在我的远程 Jenkins 中安装了 RVM,当我在 shell 下执行时.
#!/bin/bash -x源 ~/.bashrcrvm 使用 1.9.3@rails-3.2.3
我收到以下错误.
+ source/var/lib/jenkins/.bashrc++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin:/var/lib/jenkins/.rvm/bin+ rvm 使用 1.9.3@rails-3.2.3RVM 不是一个函数,选择带有rvm use ..."的红宝石将不起作用.您需要更改终端设置以允许 shell 登录.例如,请访问 https://rvm.io/workflow/screen/.
什么意思?我不知道.请帮帮我.
更新:我在脚本下面尝试过,但我仍然遇到错误:
#!/bin/bash -x源/home/zeck/.bashrc[[ -s ".rvmrc" ]] &&源.rvmrc出口 RAILS_ENV=test捆绑安装
错误:
/tmp/hudson457106939700368111.sh: line 5: bundle: command not found构建步骤执行 shell"将构建标记为失败完成:失败
Jenkins 构建 shell 无法检测到 RVM、gemsets 和 gems.我该怎么办?
更新 2:因此 jenkins 无法检测到 ruby.
+ ruby -v/tmp/hudson2505951775163045158.sh:第5行:ruby:找不到命令构建步骤执行 shell"将构建标记为失败完成:失败
我没有使用任何 jenkins 插件,我只是从 Build->Execute shell 部分运行脚本.
尝试:
<预><代码>.$(/home/RVM_USER/.rvm/bin/rvm env 1.9.3@rails-3.2.3 --path)确保您运行稳定的 RVM:
rvm 稳定
注意:最后一个 Jenkins 版本并不总是接受源代码",而是.".RVM_USER 是安装 RVM 的用户.或者,您也可以在主 PATH 中导出 RVM 命令.
I am new to Jenkins CI. I'm install RVM in my remote Jenkins and when I execute below shell.
#!/bin/bash -x
source ~/.bashrc
rvm use 1.9.3@rails-3.2.3
I get following errors.
+ source /var/lib/jenkins/.bashrc
++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin:/var/lib/jenkins/.rvm/bin
+ rvm use 1.9.3@rails-3.2.3
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal settings to allow shell login.
Please visit https://rvm.io/workflow/screen/ for example.
What does it mean? I don't have any idea. Please help me.
UPDATED: I'm tried below script but I still get errors:
#!/bin/bash -x
source /home/zeck/.bashrc
[[ -s ".rvmrc" ]] && source .rvmrc
export RAILS_ENV=test
bundle install
Errors:
/tmp/hudson457106939700368111.sh: line 5: bundle: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Jenkins build shell can't detect RVM, gemsets and gems. What should I do?
UPDATED 2: Therefore jenkins can't detect ruby.
+ ruby -v
/tmp/hudson2505951775163045158.sh: line 5: ruby: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILUR
I'm not using any jenkins plugn and I'm just run script from Build->Execute shell section.
try:
. $(/home/RVM_USER/.rvm/bin/rvm env 1.9.3@rails-3.2.3 --path)
make sure you run the stable RVM:
rvm get stable
NOTE: Last Jenkins version does not always accept "source", but ".". RVM_USER is the user that installed RVM. Alternatively you can also export the RVM command in the main PATH.
这篇关于RVM 和 Jenkins 设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!