Rbenv: https://github.com/sstephenson/rbenv
Ruby-build: https://github.com/sstephenson/ruby-build
Rbenv Installation
As root
cd /opt
git clone git://github.com/sstephenson/rbenv.git rbenv
touch /etc/profile.d/rbenv
echo 'export RBENV_ROOT=/opt/rbenv' >> /etc/profile.d/rbenv
echo 'export PATH=/opt/rbenv/bin:$PATH' >> /etc/profile.d/rbenv
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv
edit /root/.bashrc and add on the very top of the file
source /etc/profile.d/rbenv
edit /home/#your_user_name#/.bashrc and add on the very top of the file
source /etc/profile.d/rbenv
Ruby-build installation
exec $SHELL
mkdir -p $RBENV_ROOT/plugins
cd $RBENV_ROOT/plugins
git clone git://github.com/sstephenson/ruby-build.git
echo 'export PATH="$RBENV_ROOT/plugins/ruby-build/bin:$PATH"' >> /etc/profile.d/rbenv
exec $SHELL
At that point you are all set-up, ready to install any version of ruby
Ruby Installation
Example with versions 2.1.2 and 1.9.3p545, but you can choose any version you want
rbenv install 2.1.2
rbenv install 1.9.3p545
Set global version of ruby
rbenv global 2.1.2
Set locale version of ruby
cd /your/project/directory
rbenv local 1.9.3p545
Install Bundler
Note that before running bundler from your application root to install your gems you will have to install bundler it self with the following command
gem install --no-rdoc --no-ri bundler rake
rbenv rehash
Update rbenv
cd /opt/rbenv
git pull
cd /opt/rbenv/plugins/ruby-build
git pull
rbenv rehash