Problems running a job with rake

188 views
Skip to first unread message

ziffification

unread,
Jun 7, 2016, 6:30:32 PM6/7/16
to Jenkins Users

I have rake running as default OS version of ruby 




Building in workspace /var/lib/jenkins/workspace/test2
[test2] $ rake --rakefile /var/lib/jenkins/workspace/test2/Rakefile features
FATAL: rake execution failed
java.io.IOException: Cannot run program "rake" (in directory "/var/lib/jenkins/workspace/test2"): error=2, No such file or directory

if I run rake from the command line as myself it all works:

[robm@pp000c2929b742 test2]$ rake --rakefile /var/lib/jenkins/workspace/test2/Rakefile features
/usr/bin/ruby -I "lib" "/usr/local/share/gems/gems/cucumber-2.3.3/bin/cucumber" --format json features/testEbiSingle.feature > /var/lib/jenkins/workspace/test2/report.json
[robm@pp000c2929b742 test2]$


this is the only build step I have , also I made sure the jenkins user had bas as the shel and .bashrc had /usr/bin added (where rake is)
jenkins:x:985:979:Jenkins Continuous Integration Server:/var/lib/jenkins:/bin/bash


[robm@pp000c2929b742 test2]$ cat /var/lib/jenkins/.bashrc
export PATH="$PATH:$HOME/.rvm/bin:/usr/local/bin" # Add RVM to PATH for scripting








any ideas on how to get this working?


Björn Pedersen

unread,
Jun 8, 2016, 8:53:41 AM6/8/16
to Jenkins Users


Am Mittwoch, 8. Juni 2016 00:30:32 UTC+2 schrieb ziffification:

I have rake running as default OS version of ruby 




Building in workspace /var/lib/jenkins/workspace/test2
[test2] $ rake --rakefile /var/lib/jenkins/workspace/test2/Rakefile features
FATAL: rake execution failed
java.io.IOException: Cannot run program "rake" (in directory "/var/lib/jenkins/workspace/test2"): error=2, No such file or directory

if I run rake from the command line as myself it all works:

[robm@pp000c2929b742 test2]$ rake --rakefile /var/lib/jenkins/workspace/test2/Rakefile features
/usr/bin/ruby -I "lib" "/usr/local/share/gems/gems/cucumber-2.3.3/bin/cucumber" --format json features/testEbiSingle.feature > /var/lib/jenkins/workspace/test2/report.json
[robm@pp000c2929b742 test2]$




.bashrc is only read if the shell is interactive.  Either explicitly set the path in your job, or call rake with absolute pathes. See man bash for details.

ziffification

unread,
Jun 9, 2016, 1:32:03 PM6/9/16
to Jenkins Users
thanks Bjorn!

can I ask how I specify the path ?  it looks like in the pull down you can just select a version of rake 

Björn Pedersen

unread,
Jun 10, 2016, 3:56:57 AM6/10/16
to Jenkins Users
jenkins -> Manage jenkins -> global tool configuration
(or if you have many slaves with different locations,  in node config -> node properties.

Björn

ziffification

unread,
Jul 14, 2016, 1:11:43 PM7/14/16
to Jenkins Users
ok here is the problem int that page i have no rake in global tools config




so then I go to jenkins>configure system  where I have :




So I am unsure how to configure this? any suggestions?

ziffification

unread,
Jul 14, 2016, 6:03:16 PM7/14/16
to Jenkins Users
basically my problem boils down to

How do I get the jenkins user to see rake which is located in:/usr/local/bin/rake

Building in workspace /var/lib/jenkins/workspace/test2
[test2] $ rake --rakefile /var/lib/jenkins/workspace/test2/Rakefile features
FATAL: rake execution failed
java.io.IOException: Cannot run program "rake" (in directory "/var/lib/jenkins/workspace/test2"): error=2, No such file or directory


ziffification

unread,
Jul 14, 2016, 6:44:58 PM7/14/16
to Jenkins Users
ok solved looking in the Jenkins config area I was able to find what it thought the $PATH was and I inserted a link to rake there

http://10.80.84.40:8080/systemInfo




On Tuesday, June 7, 2016 at 4:30:32 PM UTC-6, ziffification wrote:
Reply all
Reply to author
Forward
0 new messages