简体   繁体   English

RVM / Ruby / Bundle / Cucumber在Jenkins上不起作用

[英]RVM/Ruby/Bundle/Cucumber not working on Jenkins

When I try to run my cucumber scripts (or RVM/Ruby/Bundle) on Jenkins, I get the following error (command not found): 当我尝试在Jenkins上运行我的黄瓜脚本(或RVM / Ruby / Bundle)时,出现以下错误(找不到命令):

Started by user anonymous
Building in workspace /Users/Shared/Jenkins/Home/jobs/Testing/workspace
[workspace] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson6097735085503119949.sh
+ cucumber features/scheduling/scheduling_nonlive/schedule_page.feature --line 4 --format json -o cucumber.json
/Users/Shared/Jenkins/tmp/hudson6097735085503119949.sh: line 2: cucumber: command not found
Build step 'Execute shell' marked build as failure

After Googling, I'm fairly confident is has to do with some RVM and PATH/permissions problems from Jenkins. 在Google搜索之后,我相当有信心与Jenkins的一些RVM和PATH /权限问题有关。 How do I change the PATH so Jenkins can use the same PATH that I use? 如何更改PATH,以便Jenkins可以使用我使用的相同PATH?

~% which cucumber
/Users/fyousuf/.rvm/gems/ruby-2.0.0-p247/bin/cucumber

~/.jenkins% pwd
/Users/fyousuf/.jenkins

~/.jenkins% which rvm
/Users/fyousuf/.rvm/bin/rvm

~/.jenkins% which ruby
/Users/fyousuf/.rvm/rubies/ruby-2.0.0-p247/bin/ruby

My ~/.bashrc contains: 我的〜/ .bashrc包含:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

My .bash_profile: 我的.bash_profile:

 PATH=/usr/local/bin:/usr/local/mysql/bin:/usr/local/jruby-1.7.5/bin:$PATH
 [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Has anyone run into a similar issue and knew how to solve it? 有谁遇到过类似的问题并且知道如何解决?

使用此路径进行cucumber

/Users/fyousuf/.rvm/wrappers/ruby-2.0.0-p247/cucumber

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM