When I try to run my cucumber scripts (or RVM/Ruby/Bundle) on Jenkins, I get the following error (command not found):
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. How do I change the PATH so Jenkins can use the same PATH that I use?
~% 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:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
My .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?