Unable to resolve Ruby error (missing psych)

删除回忆录丶 提交于 2019-11-29 03:46:54

I had this problem and installing libyaml didn't help. It turned out that libyaml-devel was needed by psych. I was on centos6 so I did this:

curl -O http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/atomic-release-1.0-14.el6.art.noarch.rpm

sudo  rpm -Uvh atomic-release-1.0-14.el6.art.noarch.rpm

sudo yum install libyaml-devel

rvm reinstall 1.9.3-p194

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

On a RHEL based distro such as CentOS 6.x you need to add another yum repository such as EPEL which contain the libyaml-devel package.

Keys for EPEL or download
RPM for EPEL

More info:

Would also suggest the use of yum-plugin-priorities

Add EPEL Yum Repository

rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
rpm -Kih http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Install libyaml-devel via yum

yum -y install libyaml-devel

Packages

Dependencies Resolved

====================================================================================
 Package                       Arch         Version           Repository       Size
====================================================================================
Installing:
 libyaml-devel                 x86_64       0.1.3-1.el6       epel             84 k
Installing for dependencies:
 libyaml                       x86_64       0.1.3-1.el6       epel             52 k

Transaction Summary
====================================================================================
Install       2 Package(s)
Yasin

The problem could be solved by installing libyaml. Below are the corresponding packages for the most popular distributions:

  • Fedora libyaml
  • Ubuntu and other Debian based libyaml-dev
  • Some other like CentOS libyaml-devel

and also you should install the following to avoid similar problems in future:

ruby-devel libxml2 libxml2-devel libxslt libxslt-devel

In case people still hit this, I fixed it using the new autolibs feature in RVM, which automatically installs dependencies using your homebrew libraries (check out rvm help autolibs for info.)

rvm reinstall 1.9.3 --autolibs=2

You seem to be working on Fedora. Check the official Ruby website for instructions on installing on Fedora.

Try this link too http://sraji.wordpress.com/2011/01/25/how-to-install-ruby-on-fedora-14/

max kaplan

I had this same libyaml issue with CentOS 6.2

Doing...

rvm pkg install libyaml
rvm reinstall 1.9.3 --with-libyaml-dir=/usr/local/rvm/usr

Fixed it for me.

(thanks to @Eugene)

Make sure your Redhat machine has a valid subscription:

# subscription-manager list 

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.1
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         06/13/2014
Ends:           06/12/2015

Status must say "Subscribed". If not, then suffer through getting a login and maybe purchasing a subscription at https://access.redhat.com/management/consumers.

When that's done, run

# subscription-manager repos --enable rhel-7-server-optional-rpms

then libyaml-devel will install OK.

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