7

After rvm installation on CentOS 5.8:

[rails@localhost ~]$ rvm -v
rvm 1.16.17
[rails@localhost ~]$ which ruby
~/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
[rails@localhost ~]$ ruby -v
ruby 1.9.3p286 (2012-10-12 revision 37165) [i686-linux]
[rails@localhost ~]$ which gem
~/.rvm/rubies/ruby-1.9.3-p286/bin/gem

there is a warning:

$ gem -v
/home/rails/.rvm/rubies/ruby-1.9.3-p286/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.
1.8.24

I followed some advice:

$ rvm pkg install libyaml
Fetching yaml-0.1.4.tar.gz to /home/rails/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /home/rails/.rvm/src
Prepare yaml in /home/rails/.rvm/src/yaml-0.1.4.
Configuring yaml in /home/rails/.rvm/src/yaml-0.1.4.
Compiling yaml in /home/rails/.rvm/src/yaml-0.1.4.
Installing yaml to /home/rails/.rvm/usr

Please note that it's required to reinstall all rubies:

    rvm reinstall all --force

and then:

$ rvm reinstall all --force
Removing /home/rails/.rvm/src/ruby-1.8.7-p371...
Removing /home/rails/.rvm/rubies/ruby-1.8.7-p371...
No binary rubies available for: centos/5.8/i386/ruby-1.8.7-p371.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /home/rails/.rvm/rubies/ruby-1.8.7-p371, this may take a while depending on your cpu(s)...
ruby-1.8.7-p371 - #downloading ruby-1.8.7-p371, this may take a while depending on your connection...
ruby-1.8.7-p371 - #extracting ruby-1.8.7-p371 to /home/rails/.rvm/src/ruby-1.8.7-p371
ruby-1.8.7-p371 - #extracted to /home/rails/.rvm/src/ruby-1.8.7-p371
Applying patch /home/rails/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch
Applying patch /home/rails/.rvm/patches/ruby/1.8.7/no_sslv2.diff
ruby-1.8.7-p371 - #configuring
ruby-1.8.7-p371 - #compiling
ruby-1.8.7-p371 - #installing 
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.8.7-p371 ...
Installation of rubygems completed successfully.
Saving wrappers to '/home/rails/.rvm/bin'.
ruby-1.8.7-p371 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.8.7-p371 - #importing default gemsets (/home/rails/.rvm/gemsets/)
Install of ruby-1.8.7-p371 - #complete 
Please be aware that you just installed a ruby that requires 2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-286 which will have all of the latest security patches.
Making gemset ruby-1.8.7-p371 pristine.
Making gemset ruby-1.8.7-p371@global pristine.
Removing /home/rails/.rvm/src/ruby-1.9.3-p286...
Removing /home/rails/.rvm/rubies/ruby-1.9.3-p286...
No binary rubies available for: centos/5.8/i386/ruby-1.9.3-p286.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /home/rails/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracting ruby-1.9.3-p286 to /home/rails/.rvm/src/ruby-1.9.3-p286
ruby-1.9.3-p286 - #extracted to /home/rails/.rvm/src/ruby-1.9.3-p286
ruby-1.9.3-p286 - #configuring
ruby-1.9.3-p286 - #compiling
ruby-1.9.3-p286 - #installing 
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.3-p286 ...
Installation of rubygems completed successfully.
Saving wrappers to '/home/rails/.rvm/bin'.
ruby-1.9.3-p286 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p286 - #importing default gemsets (/home/rails/.rvm/gemsets/)
Install of ruby-1.9.3-p286 - #complete 
Making gemset ruby-1.9.3-p286 pristine.
Making gemset ruby-1.9.3-p286@global pristine.

Too bad, the warning is still there:

$ gem -v
/home/rails/.rvm/rubies/ruby-1.9.3-p286/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.
1.8.24

How can I get rid of the warning?

UPDATE: (applying rvm reinstall 1.9.3 --movable)

$ rvm reinstall 1.9.3 --movable
Removing /home/rails/.rvm/src/ruby-1.9.3-p286...
Removing /home/rails/.rvm/rubies/ruby-1.9.3-p286...
Fetching yaml-0.1.4.tar.gz to /home/rails/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /home/rails/.rvm/src
Prepare yaml in /home/rails/.rvm/src/yaml-0.1.4.
Configuring yaml in /home/rails/.rvm/src/yaml-0.1.4.
Compiling yaml in /home/rails/.rvm/src/yaml-0.1.4.
Installing yaml to /home/rails/.rvm/rubies/ruby-1.9.3-p286
Installing Ruby from source to: /home/rails/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracting ruby-1.9.3-p286 to /home/rails/.rvm/src/ruby-1.9.3-p286
ruby-1.9.3-p286 - #extracted to /home/rails/.rvm/src/ruby-1.9.3-p286
Applying patch /home/rails/.rvm/patches/ruby/1.9.3/ruby-multilib.patch
Error running 'patch -F 25 -p1 -N -f -i /home/rails/.rvm/patches/ruby/1.9.3/ruby-multilib.patch', please read /home/rails/.rvm/log/ruby-1.9.3-p286/patch.apply.ruby-multilib.log
There has been an error applying the specified patches. Halting the installation.
Making gemset ruby-1.9.3-p286 pristine.
Making gemset ruby-1.9.3-p286@global pristine.

6 Answers 6

13

After rvm pkg install libyaml, reinstall ruby 1.9.3 by:

 rvm reinstall 1.9.3 --with-libyaml-dir=/home/rails/.rvm/usr

credit: https://stackoverflow.com/a/12882906/88597

2
  • based on the error message you're getting (To eliminate this warning, please install libyaml and reinstall your ruby.) this should fix your problem. My personal experience with rvm has been that it's a world of pain and suffering though so your mileage may vary :-)
    – voretaq7
    Oct 25, 2012 at 21:19
  • Finally, thankyou! I've "rvm pkg install libyaml; rvm reinstall 1.9.3"'d a hundred times.
    – rrrhys
    Mar 18, 2013 at 9:28
2
sudo apt-get install libtool
sudo apt-get install libyaml-dev
rvm reinstall 1.9.3

I've tried all, this solved my problem.

1

try this:

rvm get head
rvm reinstall 1.9.3 --movable
2
  • "There has been an error applying the specified patches. Halting the installation." (See UPDATE in question)
    – ohho
    Oct 25, 2012 at 6:53
  • updated my answer - you need to get newer rvm first
    – mpapis
    Oct 25, 2012 at 9:36
0

I think you have to install the libyaml:

$ 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 
$ make install

refer to: http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/

5
  • I am installing rubies via rvm at user level, not system-wide.
    – ohho
    Oct 25, 2012 at 6:57
  • you have to make sure your OS has libyaml installed, no matter if the RVM is installed at user level or system-wide. and, if you don't have sudo access, just modify the --prefix parameter, and then install rvm with additional parameters.
    – Siwei
    Oct 25, 2012 at 7:00
  • libyaml is installed by rvm pkg install libyaml, as shown in question.
    – ohho
    Oct 25, 2012 at 7:11
  • I want to say that you have to install the 'libyaml' by yum or make, but not rvm pkg install.
    – Siwei
    Oct 25, 2012 at 7:14
  • after installing libyaml and then rvm reinstall 1.9.3, the warning is still there.
    – ohho
    Oct 25, 2012 at 7:29
0

You can install libyaml-devel from alternative repository (I used repoforge.org):

sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
sudo rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
sudo yum install -y libyaml-devel
0

As windows user, this worked for me.

gem install yaml

And uninstall ruby and reinstall

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .