Because Ruby 1.9.3 uses psych to parse Yaml (unlike Ruby 1.8.7), Psych needs libyaml support.
First you need to update the relevant components:
Yum-y install make gcc openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel Evel Ncurses-devel sqlite3-devel mysql-devel httpd-devel wget
1. Install Libyaml
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
$ tar xzvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$./configure--prefix=/usr/local
$ make
$ make install
2. Install Ruby 1.9.3
$ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
$ tar xzvf ruby-1.9.3-p0.tar.gz
$ cd Ruby-1.9.3-p0
$./configure--prefix=/usr/local--enable-shared--disable-install-doc--with-opt-dir=/usr/local /lib
$ make
$ make install
3. Update gem
Gem Update--system or Update_rubygems or gem install Rubygems-update
4. Installing Rails
Gem install rails or gem install rails-v=3.2.1
5. Install SQLite
Yum Install Sqlite-devel
6. Build Rails Project
Rails New New_app
CD New_app
Bundle Install
Reference: http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/
Http://railsapps.github.com/rails-heroku-tutorial.html