how to solve “ruby installation is missing psych”

2019-01-07 01:58发布

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 shows up:

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

I use Mac os X 10.7 (Lion).

30条回答
2楼-- · 2019-01-07 02:26

For those with Mountain Lion and RVM version >= 1.18.x

RVM ships with this new tool that is used as a flag when installing ruby versions. It's called autolibs.

I got rid of this psych problem by doing the following:

rvm reinstall ruby-1.9.3-p392 --autolibs=3

Read the help text BEFORE by doing:

rvm help autolibs

Cool.

查看更多
叼着烟拽天下
3楼-- · 2019-01-07 02:27

On CentOS 6.3 none of the above worked. However installing libyaml from source before installing ruby resolved the problem.

$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
$ tar xzvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

and then

rvm install 1.9.3
gem install rails
查看更多
我命由我不由天
4楼-- · 2019-01-07 02:28

I had this problem. libyaml wouldn't compile. It turns out I was missing libtool.

yum install libtool
yum install libyaml (or rvm pkg install libyaml)
rvm reinstall 1.9.3

That solved my problem.

查看更多
放荡不羁爱自由
5楼-- · 2019-01-07 02:28

I reinstalled ruby 1.9.3 with libyaml support:

rvm reinstall 1.9.3 --with-libyaml

I made sure that I would use 1.9.3 before installing psych:

rvm use 1.9.3

I installed psych:

gem install psych
查看更多
女痞
6楼-- · 2019-01-07 02:30
$ brew doctor
$ brew link libyaml
查看更多
Lonely孤独者°
7楼-- · 2019-01-07 02:30

This is what worked for me on Ubuntu:
- installing libyaml-dev (sudo apt-get install libyaml-dev)
- installing rvm + ruby 1.9.3

查看更多
登录 后发表回答