This guide setup Apache2/Passenger/Ruby/Rails on a CentOS 6.4 LiveCD.
You can test it yourself using VirtualBox to run all the scripts - read VirtualBox.md for more info.
# install the necessary libraries
yum clean all
yum -y update
yum -y install curl-devel git sqlite-devel libxml2-devel
yum -y install libxml2 libxml2-devel libxslt libxslt-devel
yum -y install gcc-c++ readline-devel libyaml-devel libffi-devel openssl-devel libtool bison