"rvm use --install" broken in Jenkins, "uname: command not found"

1k views Asked by At

This is a snippet from a Jenkins job run that needs rvm 1.9.3.. I have no idea why the PATH is not being looked at. From this build the PATH environment variable looks correctly set as PATH="/usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" (as set in /etc/environment), HOME="/scratch" and SHELL="/bin/sh", so I'm mystified by this.

$ bash -c " source ~/.rvm/scripts/rvm && rvm use --install --create ruby-1.9.3 && export > rvm.env"
/scratch/.rvm/scripts/rvm: line 12: uname: command not found
/scratch/.rvm/scripts/rvm: line 15: ps: command not found
bash: rvm: command not found

I have also attempted the rbenv route but am met with similar errors indicating the absence of $PATH

Also, the Jenkins user belongs to the rvm group.

I send many internets in thanks for any assistance offered!

1

There are 1 answers

0
Armin Braun On

rvm needs login shell.

I use it like this in my builds:

echo "rvm install 2.2.3" | /bin/bash -l

Works just fine this way.