##login as sudo user
su
###then enter password
yum remove ruby
ruby -v
output must be "ruby command not found"
yum install git-core curl make bzip2 gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel libxslt-devel sqlite sqlite-devel openssl openssl-devel
yum install nodejs
\curl -sSL https://get.rvm.io | bash -s stable --rails
###if it throws GPG key error, enter the following command then again try running the above curl command
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
ctl+shift+t
##login as sudo user
rvm install 2.2.0
rvm use 2.2.0 --default
ruby -v
output must be : ruby 2.2.0p0
sudo chown -R student:student /usr/local/rvm/
exit
##Remove documents for gems
echo "gem: --no-rdoc --no-ri" >> ~/.gemrc
gem install bundler rails devise bootstrap-sass
##Check rails installation
rails -v
output must be :Rails 4.2.0
##Test by creating a sample application
rails new sample_app
cd sample_app
rails server