RMagick on OS X - HOW

Hello all.

I’m a seasoned system administrator and have no fear of building
source packages on a variety of platforms, but RMagick has, until
recently, evaded all of my attempts to building it on my PowerBook.

Someone else just mentioned that they had trouble with RMagick on
OS X (Intel, don’t really know if my advice will help) so I
decided to post a HOWTO to the list.

I generally shy away from fink/darwinports and the like: Why let
them do what I can do myself, particularly when they put things
in weird places (why, or why, not simply /usr/local?). :slight_smile:

That said, here’s my final procedure:

(I use gcc_select 3.3, though this may work with gcc_select 4.0)

Install DarwinPorts:

http://www.darwinports.org/downloads/DarwinPorts-1.2-10.4.dmg

Add /opt/local/bin to PATH.

Open Terminal:

sudo port install graphicsmagick
Do not use imagemagick as it caused bus errors when using
script/console on my system.

sudo gem install rmagick
do not attempt:
sudo port install rmagick
as it will attempt to compile an (outdated) Ruby for you.

That’s it, worked for me. Joy, happiness, rapture!

I should mention that I’ve compiled my own Ruby 1.8.4 in order to
be nice and current. I’m not certain that this will work with stock
Ruby, though after the well documented ‘fixruby’ for Mac OS X, my
stock Ruby performed fine for months before I upgraded to 1.8.4


– Tom M.

Excellent instructions. This should probably be Wikified, or at the
least,
blogged.

Tony

Thanks for the compliment.

I’ll refrain from wikifying (and blushing!) until someone tells me
they worked
for them. :slight_smile:


– Tom M.

I thought I had read somewhere that ImageMagick is a superior program
speed wise compared to GraphicsMagick. All you have to do is follow
the README_MACOSX (or whatever it’s called) in the RMagick source
EXACTLY and it works just fine. Your way is much simpler, though, for
development purposes.

-PJ

Tom:
On 09/02/06, Tom M. [email protected] wrote:

sudo port install graphicsmagick
Do not use imagemagick as it caused bus errors when using
script/console on my system.

sudo gem install rmagick
do not attempt:
sudo port install rmagick
as it will attempt to compile an (outdated) Ruby for you.

Hasans-iBook: 10:16am %which ruby
[~]
/opt/local/bin/ruby
Hasans-iBook: 10:18am %ruby --version
[~]
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]

Sure doesn’t seem outdated to me?

Cheers,
Hasan D. [email protected]

OK. when I did previously it attempted an install of 1.8.2

Thanks for the clarification.

So did:

sudo port install rmagic

work for you?


– Tom M.

On Feb 9, 2006, at 9:40 AM, PJ Hyett wrote:

I thought I had read somewhere that ImageMagick is a superior program
speed wise compared to GraphicsMagick. All you have to do is follow
the README_MACOSX (or whatever it’s called) in the RMagick source
EXACTLY and it works just fine. Your way is much simpler, though, for
development purposes.

Source?

gem install rmagick

What source? :slight_smile:

Thanks for the heads up.

The GraphicsMagick guys don’t seem to agree with your speed concerns,
though, and several independent benchmarks seem to place them both
within striking distance of one another. Supposedly GraphicsMagick
1.2 (beta currently) will be faster yet.

http://rmagick.rubyforge.org/resizing-charts.html
http://www.baschny.de/graphic-test/summary.html


– Tom M.

Tom M. wrote:

Hello all.

I’m a seasoned system administrator and have no fear of building
source packages on a variety of platforms, but RMagick has, until
recently, evaded all of my attempts to building it on my PowerBook.

Someone else just mentioned that they had trouble with RMagick on
OS X (Intel, don’t really know if my advice will help) so I
decided to post a HOWTO to the list.

Thanks! It’s been helpful - I was starting to follow the official
instructions at http://rmagick.rubyforge.org/install-osx.html
which didn’t mention using DarwinPorts to install GraphicsMagick.

I generally shy away from fink/darwinports and the like: Why let
them do what I can do myself, particularly when they put things
in weird places (why, or why, not simply /usr/local?). :slight_smile:

That said, here’s my final procedure:

(I use gcc_select 3.3, though this may work with gcc_select 4.0)

I’m using Tiger with Xcode 2.1, and didn’t alter the choice of gcc
version, so I guess I was using 4.0. I had also installed X11 and the
X11 SDK, as that’s what the original RMagick installation instructions
had said was required.

script/console on my system.

I think that has to be GraphicsMagick, rather than graphicsmagick.

sudo gem install rmagick
do not attempt:
sudo port install rmagick
as it will attempt to compile an (outdated) Ruby for you.

That failed the first time I tried it, with error messages relating to
not having found ps, or the Postscript delegate. I checked what
dependencies it had installed, comparing with the list of ports to
install before building xMagick given on the official page, and used
DarwinPorts to install ghostscript and libwmf.

sudo port install ghostscript
sudo port install libwmf

Then I tried installing the rmagick gem again, and it worked.

That’s it, worked for me. Joy, happiness, rapture!

I should mention that I’ve compiled my own Ruby 1.8.4 in order to
be nice and current. I’m not certain that this will work with stock
Ruby, though after the well documented ‘fixruby’ for Mac OS X, my
stock Ruby performed fine for months before I upgraded to 1.8.4

I’m using Ruby 1.8.2 and Gems built according to Dan Bejamin’s
instructions at HiveLogic.

thanks again

Justin

you should make sure you compiled imagemagick with X11 support. if
you run:

Magick-config --libs

look for -lX11

if not, you’ll need to recompile imagemagick and make sure when you
run configure, X11 is set.

at least that’s all i can think of…

-tak.

sudo port install graphicsmagick
Do not use imagemagick as it caused bus errors when using
script/console on my system.

sudo gem install rmagick
do not attempt:
sudo port install rmagick
as it will attempt to compile an (outdated) Ruby for you.

I have installed (ImageMagick or GraphicsMagick) and Rmagick many
different times using ports, gems, and source, and I always get the
following message when I try to display a jpeg using ImageList.new and
display:

jpegtest.rb:6:in `display’: X Window library is not available: test.jpg
(Magick::ImageMagickError)

I’m running from an Xterm in X11 on OS10.4, and all paths are added
(including /usr/X11R6/bin). Ruby 1.8.4 and gems 0.8.11 are darwinports
installed on /opt/local. Does someone know what I’m missing?

Thanks,
John