rvm 1.16.8 has libyaml (not found) problems on CentOS 5.4 w/ ruby 1.9.3 (but works with 1.15.10) #1200

scumola opened this Issue Oct 5, 2012 · 9 comments


None yet
5 participants

scumola commented Oct 5, 2012

Here's the chatscript from #rvm on freenode.

[09:24:47] Q: I'm using the latest rvm (1.16.8) under CentOS 5.4 and I can't seem to get around the missing libyaml problem even if the libyaml-devel rpm is installed at build-time. I spun up a machine a few months ago using the exact same configs, but rvm was version 1.13.6 at the time (same OS version) and that one worked really well.
[09:25:57] @mpapis swebb, this is bug in binary ruby, you can still compile ruby with: rvm reinstall 1.9.3 --disable-binary
[09:31:03] Yup. That's it. Thanks!
[09:42:49] mpapis: Does the installer work with that flag? What I'm using now is: rvm_bin_path=/usr/local/rvm/bin rvm_man_path=/usr/local/rvm/man ./rvm-installer stable
[09:43:04] oh, wait, that's the installer.
[09:43:54] @mpapis :)
[09:47:37] When I build ruby, I can pass in that --disable-binary flag?
[09:47:54] not just the rebuild command?
[09:48:34] @mpapis yes it's the same, reinstall just has few more steps more
[09:52:00] Excellent

[11:33:10] mpapis: I'm still getting that libyaml error when installing on CentOS 5.4 using the latest rvm installer w/ libyaml-devel installed and using the --disable-binary flag. https://gist.github.com/3841183
[11:33:12] <smf_bot> Title: puppet rvm ruby install � Gist (at gist.github.com, scumola on 2012-10-05 10:32)
[11:33:32] @mpapis let me have a look
[11:38:43] @mpapis swebb, you know what, try to reproduce the step manually, puppet just makes it harder to see what is going on
[11:38:50] ok.
[11:39:20] @mpapis swebb, provide a gist with the commands and outputs, include all log files mentioned,
[11:39:54] @mpapis and check with current list of rvm issues - maybe there is one that your imput will help - if not open a new one
[11:39:54] <smf_bot> rvm issues: https://github.com/wayneeseguin/rvm/issues
[11:40:57] @mpapis input
[11:45:25] https://gist.github.com/3841266
[11:45:29] <smf_bot> Title: rvm on CentOS 5.4 with libyaml error � Gist (at gist.github.com, scumola on 2012-10-05 10:45)
[11:48:00] @mpapis swebb, it looks like you missed to use ruby
[11:48:13] @mpapis like rvm use 1.9.3
[11:49:13] If I use 1.9.3, I get the same issue. Gist has been updated.
[11:49:43] @mpapis ... nothing changed
[11:50:09] I did the rvm use 1.9.3...
[11:50:22] @mpapis I do not see it in the gist
[11:50:40] oh, sorry. Saved now. :)
[11:51:28] @mpapis swebb, gist all files in /usr/local/rvm/log/ruby-1.9.3-p194/

[11:51:44] @mpapis also /usr/local/rvm/src/ruby-1.9.3-p194/config.status
[11:52:06] ok
[12:03:09] https://gist.github.com/3841373
[12:03:11] <smf_bot> Title: All log files in /usr/local/rvm/log/ruby-1.9.3-p194/* � Gist (at gist.github.com, scumola on 2012-10-05 11:02)
[12:03:25] It looks like libyaml is building and installing properly.
[12:03:53] @mpapis how about psych - did you found something in the logs
[12:04:52] Yea, in make.log it looks like it built ok.
[12:09:44] @mpapis swebb, find /usr/local/rvm/rubies/ruby-1.9.3-p194 -name psych.so
[12:12:35] @mpapis or just: find /usr/local/rvm//ruby-1.9.3-p194 -name psych.so
[13:12:59] [root@qa-bacin-app01 ~]# find /usr/local/rvm/
/ruby-1.9.3-p194 -name psych.so
[13:13:31] /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/psych.so
[13:13:40] /usr/local/rvm/src/ruby-1.9.3-p194/.ext/x86_64-linux/psych.so
[13:13:46] (that's it)
[13:14:12] @mpapis swebb, rvm info system
[13:25:13] https://gist.github.com/3841826
[13:25:15] <smf_bot> Title: rvm info system � Gist (at gist.github.com, scumola on 2012-10-05 12:25)
[13:26:22] @mpapis swebb, older fedora / redhat ?
[13:26:39] CentOS 5.4 - in AWS via RightScale.
[13:27:11] @mpapis can you: ldd /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/psych.so
[13:28:09] Yea, that shows libyaml not found: https://gist.github.com/3841839
[13:28:10] <smf_bot> Title: ldd /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/psych.so � Gist (at gist.github.com, scumola on 2012-10-05 12:27)
[13:28:28] So not in the LDD path?
[13:28:30] @mpapis ah! ok this is something to work with
[13:28:43] LD_LIBRARY_PATH ??
[13:28:56] @mpapis that would work ... but why it is missing
[13:29:09] @mpapis you have tried reinstalling it already?
[13:29:28] Yea, I did that rebuild that you suggested earlier with the --disable-binary flag.
[13:30:12] I had this issue with a different instance with the same OS/rvm version yesterday too, so it's not something broken on this machine.
[13:30:45] @mpapis ok, lets start from beginning: rm -rf $rvm_path/usr ; rvm pkg install libyaml ; rvm reinstall 1.9.3 --disable-binary
[13:30:56] @mpapis or wait
[13:31:06] @mpapis ok, lets start from beginning: rm -rf $rvm_path/usr ; rvm --debug pkg install libyaml ; rvm --debug reinstall 1.9.3 --disable-binary
[13:31:21] @mpapis and gist all the commands / outputs
[13:33:34] ok.
[13:58:43] Sorry it took so long. https://gist.github.com/3842010
[13:58:44] <smf_bot> Title: typescript � Gist (at gist.github.com, scumola on 2012-10-05 12:58)
[13:58:58] Had the hardest time getting rid of those ansi color codes. :)
[13:59:20] @mpapis --color=0
[13:59:38] @mpapis I will have a look in few inutes
[14:01:02] Sure, no problem. Thanks.
[14:14:16] @mpapis swebb, I have a need for gists with color ;)
[14:14:25] @mpapis that would save my day!
[14:16:59] Yea, they do color for known languages, but my output was just normal text. Colorized stuff is way easier to read though, I agree.
[14:21:53] @mpapis they could just allow colored text
[14:23:01] @mpapis swebb, can you run ldd now ?
[14:23:20] Same. libyaml.so is unlinked.
[14:23:57] @mpapis ok: find /usr/local/rvm/usr -name "libyaml_.so_"
[14:25:20] [root@qa-bacin-app01 ~]# find /usr/local/rvm/usr -name "libyaml_.so_"
[14:25:20] /usr/local/rvm/usr/lib/libyaml-0.so.2
[14:25:20] /usr/local/rvm/usr/lib/libyaml.so
[14:25:20] /usr/local/rvm/usr/lib/libyaml-0.so.2.0.2
[14:26:52] @mpapis so the missing file is in /usr/local/rvm/usr/lib ?
[14:27:07] @mpapis and this path was given to ruby compilation
[14:27:33] Seems that way.
[14:28:31] Doesn't seem to make a lot of sense.
[14:28:43] @mpapis swebb, show me: ruby -rrbconfig -e "puts RbConfig::CONFIG['configure_args']"
[14:29:00] '--enable-shared' '--disable-install-doc' '--prefix=/usr/local/rvm/rubies/ruby-1.9.3-p194' 'CFLAGS=-I/usr/local/rvm/usr/include' 'LDFLAGS=-L/usr/local/rvm/usr/lib'
[14:29:11] It's there.
[14:29:22] @mpapis looks like a bug in ruby
[14:29:38] @mpapis can you get back to rvm 1.15.10 and confirm the same behavior?
[14:30:03] @mpapis I'm trying to eliminate rvm from the equation
[14:31:48] Note: this didn't show up with rvm 1.13.6 and the same ruby version.
[14:32:04] but that's several months old.
[14:32:23] @mpapis swebb, yeah the same machine/updates?
[14:32:50] Different machine, but was built with the same AWS image and puppet configs.
[14:33:13] @mpapis could you have a try with rvm 1.15.10?
[14:33:20] Sure. That might take me a little while.
[14:33:27] @mpapis it looks like ruby is miss behaving
[14:39:27] curl -L https://raw.github.com/wayneeseguin/rvm/1.15.10/binscripts/rvm-installer | bash
[14:39:34] That installed 1.16.8 for me.
[14:39:41] @mpapis no: rvm get 1.15.10
[14:39:46] Ahh
[14:40:14] @mpapis the installer is universal for everything, if you need something different then head - you go with switches
[14:40:20] That's bad ass.
[14:40:25] :)
[14:49:05] Looks happy with 1.15.10: https://gist.github.com/3842292
[14:49:06] <smf_bot> Title: with 1.15.10 � Gist (at gist.github.com, scumola on 2012-10-05 13:48)
[14:49:27] @mpapis sh.t
[14:49:30] @mpapis sorry
[14:49:52] That's ok. I can file a bug if you'd like.
[14:50:10] @mpapis swebb, can you report it as an issue, I will have a look on it later, I guess you can go with the version you just compiled
[14:50:20] Yup. Will do. Thanks for all of the help today.
[14:50:37] @mpapis please include the two gists with debug output, maybe it can help me
[14:51:22] @mpapis swebb, also is there a way I can get the image running on vagrant / VirtualBox / Xen ?
[14:52:10] If we can figure out a way to convert a running AWS image to vagrant/VB/xen, then sure.
[14:52:22] I can just tar up the whole filesystem if you want, but that won't give you a running OS.
[14:52:42] @mpapis maybe with chroot ...
[14:52:50] @mpapis let it be last resort
[14:52:55] Sure.
[14:53:13] @mpapis I feel like it will be hard to reproduce

scumola commented Oct 5, 2012

If you would like to spin up the instance in AWS, the AWS image is: RightImage_CentOS_5.4_x64_v5.5.9 (ami-0f42a966).


richo commented Oct 7, 2012

I have an AWS account, I'll get the all clear to use it for testing


mpapis commented Oct 10, 2012

by any chance might it be related to #1203? -> I have prepared a patch for it, could you try this:

curl -Lhttps://raw.github.com/gist/3854178/fcd2f6d774cd35483f73d43c2ab9ee49405a287e/cflags.patch -o cflags.patch
rvm reinstall 1.9.3 --patch cflags.patch

I just wanted to comment that downgrading to 1.15.10 also worked for me, on CentOS 5.6 using a rightimage on rackspace.

The patch here: wayneeseguin#1200 (comment) caused all sorts of autoconf problems, and compilation broke under HEAD.

I just tested again with 1.15.10 using multiuser and system wide rvm, and both work now.

I am seeing a similar problem. What is especially interesting to me is that I have two boxes with the same RVM version (1.16.17). One cannot load psych because libyaml isn't in the path, but the other can. Here's the output of ruby -rrbconfig -e "puts RbConfig::CONFIG['configure_args']":


'--prefix=/home/wsoaref/.rvm//rubies/ruby-1.9.3-p194' '--enable-shared' '--disable-install-doc' '--with-libyaml' '--with-opt-dir=/home/wsoaref/.rvm//usr'


'--enable-shared' '--disable-install-doc' '--prefix=/home/wsoaref/.rvm//rubies/ruby-1.9.3-p194' 'CFLAGS=-I/home/wsoaref/.rvm//usr/include' 'LDFLAGS=-L/home/wsoaref/.rvm//usr/lib'

mpapis commented Oct 31, 2012

@patrick-higgins try this:

rvm reinstall 1.9.3 --with-libyaml

I finally figured this out for my systems:

~# ldd /usr/local/rvm/./gems/ruby-1.9.3-p194/gems/psych-
linux-vdso.so.1 => (0x00007fff40788000)
libruby.so.1.9 => /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/libruby.so.1.9 (
libyaml-0.so.2 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b0824197000)
librt.so.1 => /lib64/librt.so.1 (0x00002b08243b2000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b08245bc000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b08247c0000)
libm.so.6 => /lib64/libm.so.6 (0x00002b08249f8000)
libc.so.6 => /lib64/libc.so.6 (0x00002b0824c7c000)
/lib64/ld-linux-x86-64.so.2 (0x00002b0823900000)

EPEL provides only libyaml-0.1.2-3.el5, and that library comes from libyaml-0.1.4-1.el5.

The real problem is that the ldconfig cache does not know about /usr/local/rvm/usr/lib, and you need to add the path:

/sbin/ldconfig /usr/local/rvm/usr/lib

After that, everything is working fine.



Changing the system-wide ldconfig cache is not a great way to solve this. The psych.so should include that directory in it's rpath. Here's the difference between my working install and the broken one:


objdump -p ./ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/psych.so | grep RPATH
  RPATH       /home/wsoaref/.rvm//usr/lib:/home/wsoaref/.rvm//rubies/ruby-1.9.3-p194/lib


objdump -p ./ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/psych.so | grep RPATH
  RPATH       /home/wsoaref/.rvm//rubies/ruby-1.9.3-p194/lib

As you can see, /home/wsoaref/.rvm//usr/lib is in the working psych.so rpath, and that is where libyaml-0.so.2 is found.

It appears the --with-opt-dir option is what is saving us, and master has comments that support for it is a TODO item. In the meantime, if LDFLAGS is being used in __rvm_update_configure_opt_dir_flags, adding -Wl,-rpath,$1/lib to it should resolve the issue.

mpapis was assigned Nov 9, 2012

mpapis closed this in 2b442bc Nov 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment