Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use rvm in shell scripting

Tags:

bash

rvm

is it possible to load rvm in shell script . can any one give an example of it. when i try a shell script . i am using ubuntu system

#!/bin/bash
rvm use 1.9.3

it gives me error

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
like image 619
user1328342 Avatar asked Nov 13 '13 12:11

user1328342


1 Answers

You can just include rvm in your script by doing:

source ~/.rvm/scripts/rvm

then rvm should be available to your script,

like image 193
jbr Avatar answered Sep 19 '22 05:09

jbr