Fixing the “ruby installation is missing psych” error?

孤者浪人 提交于 2019-12-12 08:21:19

问题


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!


回答1:


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



回答2:


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




回答3:


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.




回答4:


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://stackoverflow.com/a/12361446/341994




回答5:


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!



来源:https://stackoverflow.com/questions/9880855/fixing-the-ruby-installation-is-missing-psych-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!