RVM is not a function, choosing rubies using "rvm use ..." will not work from jenkinsfile
I am trying to use ruby ββversion via RVM in my Jenkinsfile like:
sh 'rvm use ruby 2.3.1'
However, I believe that the above command does not do what it is intended to do because I get this message after it
+ rvm use ruby 2.3.1
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
I have read other answers suggesting to add #!/bin/bash -xl
, however I am using this from Jenkinsfile
, not a bash script.
Is there a way to resolve this? I just want to install ruby ββto 2.3.1 and then run one command.
I also tried using create default
but still the printable ruby ββversion is 2.0.0
sh '''
#!/bin/bash -xl
echo $PATH
rvm install ruby-2.3.1
rvm alias create default 2.3.1 && ruby --version
ruby --version
'''
+3
source to share