CentOS 6 ships with updated version of Ruby (version 1.8.7), but does not include the flexibility provided by the Ruby Version Manager (RVM). You will definitely want to use RVM, as it lets you easily manage the roll-forward and roll-back of Ruby and associated Gemsets. Assuming you begin with a Minimal installation of CentOS 6, here is how you install RVM:
1) Install the base packages Ruby needs (all 115 of them)
yum groupinstall "Development Tools"
2) Install NTP and force a time update.
yum install ntp ntpdate tick.gatech.edu
3) Install zlib and sqlite3
yum install zlib zlib-devel sqlite-devel
4) Download and install RVM
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)UPDATE: bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Once installed, log out of your SSH session, then log back in.
5) Verify your RVM installation. You should see “RVM is a function” echoed back.
type rvm | head -1
6) Install Ruby version 1.9.2
rvm install 1.9.2
7) Set version 1.9.2 to be the default Ruby version.
rvm use 1.9.2 --default
8) Verify your version of Ruby is 1.9.2
9) Install Rake gem
gem install rake
10) Install Rails gem
gem install rails
11) Verify Rails install
12) Install SQLite gem
gem install sqlite3
You should now have a fully functioning Ruby development environment for your CentOS Linux server.