RMagick for Fedora Core 6 - (How to overcome [BUG] Segmentation fault)

I have a fresh copy of fedora core 6 installed on my own server which I use for personal projects (like my brother-in-law’s piano website). Recently, I wanted to install RMagick on the server for a image-uploading gallery I put on (using the wonderful file-column plugin). I used the distro version of ruby from the rpm repositories, and the rpm specifically compiled for fedora core 6 from the website, and the gem command line to install rmagick.

gem install rmagick
All successful? No. The gem compiled, but I got a whole ton of errors when it tried to generate the documentation. Apart, nothing worked. The examples couldn’t find the “RMagick” gem, which was strange. So, in the example spinner.rb, I put “require ‘rubygems’” at the top. Then I ran it. Everything would run, until it got to the line:

spinner.write(’spinner.gif’)

It would die horrendously, and say [BUG] Segmentation fault.

The fix?

Finding a fix wasn’t easy - in fact, I couldn’t seem to find anyone who was running in to the same problem as me.  So, if you found this blog post on google, my time writing this article will have been worth it.
The fix was a little more simple, but not so obvious.  Apparently Fedora Core 6 ruby packages are bunk.  To fix it, I had to uninstall all of the distro ruby packages, and then recompile ruby from source (available at ruby-lang.org). Then, I compiled imagemagick from source, and rmagick from source, using the directions provided.

Recompiling everything from source
Before you embark on the course, make sure you have all of the required devel packages (and binary). If you type this command, it should get them all for you

yum install libjpeg-devel libpng-devel glib2-devel fontconfig-devel zlib-devel libwmf-devel freetype-devel libtiff-devel

You’ll also want these for ruby-readline support

yum install readline-devel ncurses-devel openssl-devel
Compiling ruby

Before compiling, make sure you get rid of any ruby packages installed (to keep things clean). You can get a list of them by typing:

rpm -qa | grep ruby

Then, remove them with this:

rpm -e ruby libruby
To compile ruby, get the latest stable source code from here

http://www.ruby-lang.org/en/downloads/

wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5-p12.tar.gz (or whatever the current version is)
tar xzf ruby-1.8.5-p12.tar.gz
./configure
make
sudo make install

You should now have a working fresh version of ruby.

For the rest of the installation, I followed the wonderful walkthrough here: http://rmagick.rubyforge.org/install-linux.html

Buena suerte!

3 Responses to “RMagick for Fedora Core 6 - (How to overcome [BUG] Segmentation fault)”

  1. mdeering Says:

    rpm -e ruby libruby
    error: package libruby is not installed

    This line does nothing for me. Do you mean to execute this line with “libruby” replaced by each of the rpms listed by the command

    rpm -qa | grep ruby

    ruby-ri-1.8.5.2-1.fc6
    ruby-mysql-2.7.1-2.fc6
    ruby-docs-1.8.5.2-1.fc6
    ruby-libs-1.8.5.2-1.fc6
    ruby-irb-1.8.5.2-1.fc6
    subversion-ruby-1.4.2-2.fc6
    ruby-1.8.5.2-1.fc6
    rubygems-0.9.1-1.fc6
    ruby-mode-1.8.5.2-1.fc6
    ruby-devel-1.8.5.2-1.fc6
    ruby-rdoc-1.8.5.2-1.fc6

    Thanks

  2. Christian Hamer Says:

    I had the same problem on FC6 with ‘gem install rmagick’ throwing off lots of errors when trying to generate documentation. Turns out it was looking for TrueType fonts in /usr/share/fonts/default/TrueType. I worked around this by making sure corefonts (http://corefonts.sf.net) was installed and then:
    # cd /usr/share/fonts/default
    # ln -s ../msttcorefonts TrueType
    then re-running ‘gem install rmagick’ which ran to completion with no errors. My rmagick scripts now work fine without having to rebuild anything else. I don’t love the symlink solution, but it’s straightforward and does work for me with the FC6 versions of ruby, ImageMagick[-devel], etc.

  3. Frank Says:

    Thanks. Very helpful. And it worked like a champ on my f6.

Leave a Reply

You must be logged in to post a comment.