Let's assume that you have shell access to your shared hosting service.
rvm is a
ruby version management solution which makes it possible to install different versions of ruby on a computer and switch between them on the fly without causing too much trouble.
$ \curl -sSL https://get.rvm.io ' bash -s stable
You might get a few warnings, it's better if you address those before proceeding.
Now if everything has gone as planned, rvm should have added itself to your path somewhere in
.bashrc or even in a separate
.profile file which should be sourced in your
.bash_profile (by adding
source ~/.profile to your
.bash_profile). Run the script to update the path (or simply logout and login again).
$ source ~/.bash_profile
The easy way -- Installing a binary
If you prefer to use ready-made binaries from rvm.io, you can head to the list of binaries and choose the proper binary which matches to your host's OS version and machine arch (e.g. Centos 5.6 x86_64). Then mount the remote binary using
$ rvm mount -r http://rvm.io/binaries/centos/5/x86_64/ruby-1.9.3-p547.tar.bz2
Now you can tell
rvm to use this version:
$ rvm use 1.9.3
The hard way -- Compile from source
If your web hosting provider lets you compile stuff on their server you can try compiling
$ cd ~ $ wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz $ tar zxvf ruby-1.8.2.tar.gz $ cd ruby-1.8.2 $ ./configure --prefix=$HOME/opt/ruby-1.8.2 && make && make install $ rvm mount ~/opt/ruby-1.8.2 -n 1.8.2 $ rvm use 1.8.2