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,110 points
169 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
• 42,430 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
• 6,880 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,280 points
355 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
• 6,880 points
1,078 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
1,157 views
0 votes
2 answers

How to create backup and copy files in jenkins?

You would require to copy and take ...READ MORE

answered Aug 1 in Jenkins by Sirajul
• 38,740 points
544 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
216 views
0 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
• 42,430 points
961 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 in Jenkins by Kalgi
• 42,430 points
2,289 views