Whenever I run something with Ruby on my server, I get the following error:
/usr/local/rvm/rubies/ruby-1.9.3-p194/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.
I installed Ruby using RVM onto my VPS.
I’ve tried installing the package libyaml
as per instructed in other issues on Stack Overflow, to no avail.
I’m not sure what type of system my VPS is running, but it doesn’t have the apt-get
command. It does have yum
…
You seem to be working on Fedora. Check the official Ruby website for instructions on installing on Fedora.
Try this link too http://sraji.wordpress.com/2011/01/25/how-to-install-ruby-on-fedora-14/
I have to disagree with @JunaidKirkire in that I think you are running CentOS or Redhat 5 which uses a a very old version of Ruby by default and I think using RVM is a much better way to go. I believe you will just need to compile libyaml from source with the following:
rvm pkg install libyaml
This will tell you the directory that it is compiling into, in my case, it is
/Users/ehowe/.rvm/usr
You then need to recompile Ruby with the following option:
rvm reinstall 1.9.3 --with-libyaml-dir=$directory_that_rvm_installed_libyaml_to
So in my case, I would do:
rvm install 1.9.3 --with-libyaml-dir=/Users/ehowe/.rvm/usr
If you are running rvm as root, this will get installed into
/usr/local/rvm/usr
. If you are running it as a user, as is recommended, it would be/home/$user/.rvm/usr
On a RHEL based distro such as CentOS 6.x you need to add another yum repository such as EPEL which contain the libyaml-devel package.
Keys for EPEL or download
RPM for EPEL
More info:
Would also suggest the use of yum-plugin-priorities
Add EPEL Yum Repository
Install libyaml-devel via yum
Packages
The problem could be solved by installing
libyaml
. Below are the corresponding packages for the most popular distributions:libyaml
libyaml-dev
libyaml-devel
and also you should install the following to avoid similar problems in future:
I had this same libyaml issue with CentOS 6.2
Doing...
Fixed it for me.
(thanks to @Eugene)
In case people still hit this, I fixed it using the new autolibs feature in RVM, which automatically installs dependencies using your homebrew libraries (check out
rvm help autolibs
for info.)rvm reinstall 1.9.3 --autolibs=2