Thursday, July 8, 2010

RVM

I've been trying to get RVM to work for about three hours now. The problem I was having is that I can install and view all the different rubies I have installed but I can't seem to be able to use any of them. I had installed it using the root user on an Ubuntu 4.4.3-4ubuntu5 system.
rvm use 1.9.1

info: Using ruby 1.9.1 p378
Doesn't work. It would still stick with my default ruby.
ruby -v
ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770,
Ruby Enterprise Edition 2010.02

It turns out I needed to add this little line to my /etc/profile,
if [ -s "$HOME/.rvm/scripts/rvm" ] ; then
  . "$HOME/.rvm/scripts/rvm"
elif [ -s "/usr/local/rvm/scripts/rvm" ] ; then
  . "/usr/local/rvm/scripts/rvm"
fi
Then source it;
root@socialstats:~# source /etc/profile
root@socialstats:~#

Viola! I have rubies that work now!
root@socialstats:~# rvm use 1.9.1

info: Using ruby 1.9.1 p378
root@socialstats:~# ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]
root@socialstats:~# 

There's an entire script out there that you can run. Just do a search for "rvm use"

No comments:

Post a Comment