由于Ruby 1.9.3使用psych来解析YAML(不同于Ruby 1.8.7),而psych需要libyaml的支持。
首先需要更新一下有关组件:
yum -y install make gcc openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel ncurses-devel sqlite3-devel mysql-devel httpd-devel wget which
1. 安装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. 安装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. 更新GEM
gem update --system 或者 update_rubygems 或者 gem install rubygems-update
4. 安装rails
gem install rails 或者 gem install rails -v=3.2.1
5. 安装sqlite
yum install sqlite-devel
6. 建立rails工程
rails new new_app
cd new_app
bundle install
参考:http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/
http://railsapps.github.com/rails-heroku-tutorial.html