RMagick with Ruby Enterprise on CentOS 5
This was a lot trickier than it should have been due to a new “feature” in REE whereby it reports its version on two lines like this:
[root@myserver rmagick]# ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]
Ruby Enterprise Edition 20090610
Unfortunately the RMagick gem uses this to initialize a string constant, RUBY_VERSION_STRING used in rmmain.c. The constant is defined in “configure.ac”, which is used by autoconf to produce “configure”. While the autoconf file is present, it’s not used (fortunately since most people won’t have autoconf installed) so the “configure” file needs to be patched.
While rubygems are great when they work, patching them is another matter. First you need to wget the gem, which is a tar containing a couple of compressed files, data.tar.gz and metadata.gz. Extract the data.tar.gz using gtar, then change the RUBY_VERSION_STRING in “configure” from:
RUBY_VERSION_STRING=`$RUBY –version`
to:
RUBY_VERSION_STRING=`$RUBY –version | head -n 1`
Then rebuild the gem. To see how read my next post.
Or you can download my patched gem here.
Nice! Have you submitted this patch to the rmagick author as well?
nice tutorial