RVM and Jenkins setup

0 votes

I’m a fresher when it comes to Jenkins CI and I’ve installed RVM in my remote Jenkins. When I try to execute the following shell commands,

#!/bin/bash -x
source ~/.bashrc
rvm use 1.9.3@rails-3.2.3

I get the the error

+ source /var/lib/jenkins/.bashrc
++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin:/var/lib/jenkins/.rvm/bin
+ rvm use 1.9.3@rails-3.2.3
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal settings to allow shell login.
Please visit https://rvm.io/workflow/screen/ for example.

Where am I going wrong?

Aug 9, 2018 in Jenkins by lina
• 8,220 points
1,820 views

2 answers to this question.

0 votes

adding a shebang to the build commands in jenkins fixed this for me

    #!/usr/bin/env bash
    rvm use 2.0.0
    bundle install
    rake test
    ...

answered Aug 9, 2018 by Kalgi
• 52,350 points
0 votes

Try this:

. $(/home/RVM_USER/.rvm/bin/rvm env 1.9.3@rails-3.2.3 --path)

make sure you run the stable RVM:

rvm get stable
answered Aug 10, 2018 by Nilesh
• 7,060 points

Related Questions In Jenkins

0 votes
1 answer

How can I create global macros and templates in jenkins job builder?

you can append the path to the ...READ MORE

answered Apr 2, 2018 in Jenkins by ajs3033
• 7,300 points
1,877 views
0 votes
2 answers

Is possible for Jenkins to auto start and stop slave nodes?

Try Jenkins Plugin called as Slave SetupPlugin. This ...READ MORE

answered Aug 6, 2018 in Jenkins by Nilesh
• 7,060 points
6,881 views
0 votes
1 answer

What are parameterized jobs in jenkins and how to configure it?

Hey @Hannah, Parameterized jobs/builds are the ones ...READ MORE

answered Dec 16, 2018 in Jenkins by Kiyara
5,101 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,058 views
+2 votes
1 answer
0 votes
1 answer

Jenkins and GitHub webhook: HTTP 403

You need to create a specific user ...READ MORE

answered Aug 9, 2018 in Jenkins by Kalgi
• 52,350 points
4,901 views
+1 vote
1 answer

how to install jenkins and how to run pom.xml through jenkins

The complete process to install Jenkins can be ...READ MORE

answered Feb 12, 2019 in Jenkins by Kalgi
• 52,350 points
18,980 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP