yum remove ruby #でアンインストール
本家サイトから最新安定版を入手してくる。
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar zxvf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194
./configure --prefix=/usr
make && make install
ruby -v
wget http://rubyforge.org/frs/download.php/76073/rubygems-1.8.24.tgz
tar zxvf rubygems-1.8.24.tgz
cd rubygems-1.8.24
# ruby setup.rb
/usr/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
RubyGems 1.8.24 installed
== 1.8.24 / 2012-04-27
* 1 bug fix:
* Install the .pem files properly. Fixes #320
* Remove OpenSSL dependency from the http code path
------------------------------------------------------------------------------
RubyGems installed the following executables:
/usr/bin/gem
libyamlがインストールされていない事を表している。
gem list
# gem list
/usr/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
*** LOCAL GEMS ***
bigdecimal (1.1.0)
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.4)
yum search yaml #で検索してみる
yum list libyaml* #でインストールされているlibを確認
libyaml-devel.x86_64 0.1.2-3.el5 dag
になっていたので、
yum install libyaml-devel.x86_64 #のみをインストール。
そしてrubyをリコンパイルする
./configure --prefix=/usr/local/ruby-1.9.3-p194
make && make install
念の為、先ほどのgemsをエラー表示されないことを願いつつ再度セットアップする。
なにもでなければ以上
参考サイト:
http://blog.withsin.net/2012/04/03/ruby-centos-install/

