Fixing the "ruby installation is missing psych" error?
Asked Answered
E

5

17

I'm running Ruby ruby 1.9.3p125 and I keep getting this error which is making it impossible for me to do any kind of development in Rails.

It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.

I've Googled around and tried seemingly everything but nothing seems to be working. I'm really eager to start on some new projects but can't seem to get around this hurdle.

Any help is greatly appreciated!

Exploratory answered 26/3, 2012 at 22:33 Comment(2)
Just to rule out the obvious, have you installed libyaml and reinstalled ruby?Skyscape
Yes I have. Downloaded, configured, did a Make command, reinstalled Ruby. Didn't workExploratory
P
9

I had same problem after installing ruby 1.9.3 with rvm. I solve it by downloading yaml-0.1.4.tar.gz into ~/.rvm/archives and then reinstalled ruby again.

cd ~/.rvm/archives
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
rvm reinstall 1.9.3 

If you get some compileerrors, try with this instead

rvm reinstall 1.9.3 --with-gcc=clang
Petterson answered 12/4, 2012 at 9:25 Comment(0)
W
8

for ubuntu 64 bit nothing was working, but finally when I installed

libyaml-dev using

sudo apt-get install libyaml-dev

everything worked even with reinstalling ruby

Wilhoit answered 23/10, 2012 at 14:30 Comment(0)
C
6

The error message is a little confusing.

For Ubuntu Linux try installing

sudo apt-get install libyaml-dev

Or for openSuSE Linux run

sudo zypper install libyaml-devel

then re-compile & re-install Ruby and you should be good to go.

A couple of points, though -- run make clean to remove old compiled files. Then run sudo make install to ensure you have proper permissions for system level installs. Finally, you might get some "file 'lib' not found" errors... ignore these. Rails seems to work just fine.

Cinema answered 27/3, 2012 at 9:46 Comment(2)
I'm on OS X Lion, does that matter?Exploratory
I assume that even on OS X Lion libyaml is just the compiled lib itself while libyaml-dev provides the headers to the lib.Cinema
A
1

You need libyaml to be present at the time that Ruby 1.9.3 is built. See my answer here, describing the process (without rvm):

https://mcmap.net/q/50026/-how-to-solve-quot-ruby-installation-is-missing-psych-quot-error

Apiece answered 11/9, 2012 at 15:17 Comment(0)
T
1

Simple solution to this for me was brew install libyaml. In my case I got the message:

Warning: libyaml-0.1.6_1 already installed, it's just not linked

So, brew link libyaml produced

Linking /usr/local/Cellar/libyaml/0.1.6_1... 5 symlinks created

Done. This assumes you have homebrew, which you should. If you don't, install it thusly:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

...and then start at the top here. Cheers!

Tatum answered 29/10, 2015 at 20:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.