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:34

I was having this error and noticed I had different versions of Ruby installed with HomeBrew, along with many gems that I no longer used. So did a full clean up like this:

$ brew remove --force ruby # remove all versions installed
$ sudo rm -rf /usr/local/lib/ruby # remove all gems and leftover files
$ brew install ruby
$ gem install bundler
$ bundle install

If you don't use a Gemfile, make sure you know which gems to reinstall.

查看更多
仙女界的扛把子
3楼-- · 2019-01-07 02:35

When I switch from 64 bit to 32 bit on Snow Leopard 10.6.8, I had reinstalled ruby (used rvm) to run on 32bit and met the same problem. So I just 'cleanup' all thing that cached by rvm before and problems solved. Hope this tip can help someone.

rvm cleanup all

rvm install ruby_version_here //(This way, rvm will also re-download newest yaml).

BTW, if you still meet this problem, I think you can try:

gem install psych

查看更多
男人必须洒脱
4楼-- · 2019-01-07 02:38

In my case the solution was to add the psych gem to the Gemfile.

查看更多
我欲成王,谁敢阻挡
5楼-- · 2019-01-07 02:38

Installing ruby with rvm for mac osx, use autolibs to install libyaml and first uninstalling libyaml helps.

This worked for me:

brew uninstall libyaml
rvm autolibs enable
rvm reinstall ruby-2.1.1
查看更多
\"骚年 ilove
6楼-- · 2019-01-07 02:39

On Solaris:

# sudo crle -64 -l /usr/local/lib

to add /usr/local/lib to the shared library search path (see man crle)

查看更多
贪生不怕死
7楼-- · 2019-01-07 02:40

On Snow Leopard, the solution by Catharz did not work for me. This solution, however, did:

brew install libyaml
rvm get head
rvm reinstall 1.9.3  --with-gcc=clang

(The rvm reinstall gave me a warning about clang not having the option "--with-libyaml" but it solved the error message regardless.)

查看更多
登录 后发表回答