Macports, Snow Leopard and XCode 3.2

When I upgraded my macbook to Snow Leopard, macports just worked as it was before, or so I thought, until yesterday when I tried to install ImageMagick and rmagick ruby gem and I got this error:

gem install rmagick
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.3.5... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... no
checking for sys/types.h... no
checking for wand/MagickWand.h... no
Can't install RMagick 2.11.1. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/local/bin/ruby

After having lost the best of my youth trying to fix this issue, I can’t remember exactly how I did it, but I came up with this idea of reinstalling ruby and… guess what? It did work! So the lesson here is … whenever you upgrade to a major release of XCode, you have to reinstall all your macports. These commands can save your day or two:

$ sudo port selfupdate
$ sudo port sync
$ sudo port upgrade --force installed

;)

comments powered by Disqus