I used rvm to install ruby 1.9.3. even though it was successfully installed, it complained about libyaml. and now every time i wanna install a gem (say rails) this warning s
None of these answers worked for me.
I found my answer on https://github.com/sstephenson/ruby-build/issues/119 I am on Centos 6.3 Virtual Machine.
YOU MUST install libyaml before you install ruby. IF you ALREADY installed ruby you must get rid of the files before compiling source again!!!
# cd to your ruby source location
rm -rf /usr/local/lib/ruby # clean out ruby files
./configure
make && make install
gem -v # check if error is fixed