views:

181

answers:

3

I've got quite a strange problem. I've installed ImageMagick via homebrew.

I've installed rmagick-2.12.2 and rmagick-2.11.2 with no issues.

I get no errors on installation of either.

ImageMagick seems to be installed and in my path:

$ convert --version
Version: ImageMagick 6.5.6-5 2010-01-30 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

However, as soon as RMagick is loaded or required in a rails application, irb, ruby script, etc. the ruby process competely hangs and can only be kill via kill -9.

I'm not sure how to debug what the issue is here since there is never an error message or stacktrace. Does anyone have any suggestions?

A: 

Have you considered just using MiniMagick, http://rubyforge.org/projects/mini-magick/, rather than using RMagick? I have used RMagick very extensively and can say that you are going to abandon it eventually. Whether it is now because it is a pain to install or later because it is so memory intensive and crashes random passenger/mongrel processes, what's really the difference.

MiniMagick gives similar functionality to RMagick but is a wrapper to the command line version of convert and is much more stable because it doesn't try to invoke the ImageMagick API and manage large binary objects in memory like RMagick does.

Douglas Sellers
Unfortunately, switching to mini magick is out of my control.
BJ Clark
+1  A: 

RMagick and Ruby 1.8.6 are no longer compatible on Snow Leopard because of an obscure bug in Ruby that hasn't be backported yet.

To use RMagick and Ruby on Snow Leopard, make sure you're using Ruby 1.8.7 or above.

BJ Clark
+1  A: 

To get around this I uninstalled the rmagick gem and the macports version of imagemagick, and then reinstalled imagemagick with the installer here: http://github.com/masterkain/ImageMagick-sl. Then I reinstalled the rmagick gem.

For whatever reason, this does not trigger the but mentioned in the earlier post and rmagick will load successfully.

Mike Dotterer
This worked for me too, but make sure you use an older version of that script that uses ImageMagick 6.5, not 6.6
pjb3