Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
588 views
in Technique[技术] by (71.8m points)

installation - Unable to resolve Ruby error (missing psych)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...