How to build ImageMagick and install RMagick with MacPorts on Mac OS X Leopard
October 27th, 2007Oh holy day, brand new operating system for me to poke my grubby little fingers at!
Leopard is a piece of work that is for sure, but for some of us getting back to the bliss that was the Rails development environment on Tiger will take a little doing. In today’s journey will get RMagick running again.
Apple has provided us with a near complete rails environment out of the box, but there are two big missing pieces: the mysql gem, and rmagick.
Normally, we would simply install rmagick with:
sudo port install ImageMagick sudo gem install rmagick
But it turns out the tiff port in macports fails to build when using apples new implementation of opengl in leopard. so:
Getting RMagick, Leopard-Style
sudo port install tiff -macosx #disables the linkage with Apple's open gl sudo port install ImageMagick sudo gem install rmagick
Simple as that.












October 27th, 2007 at 12:25 pm
Thanks! That’s just what I was looking into. It’s great to see how issues are found and solved by the community.
October 27th, 2007 at 3:05 pm
But is that using Apple’s ruby and rubygems, or MacPorts? I figured out the -macosx part, but my gem won’t build. Bitching about missing freetype, which is installed.
Which ruby were you using?
October 27th, 2007 at 3:14 pm
Nevermind. I did sudo port install ImageMagick +no_x11, which means I had to do sudo port install ghostscript as well before installing the gem. Problem solved!
October 28th, 2007 at 12:31 pm
[…] following the instructions at NullStyle […]
October 28th, 2007 at 7:45 pm
I’m running into an issue when trying to install ImageMagick. I get the following error:
sudo port install ImageMagick Error: Unable to execute port: invalid command name “destroot.violate_mtree”
Any idea what’s going on?
Thanks!
October 30th, 2007 at 4:04 am
BryanD…. Do sudo port selfupdate to get 1.5.2 which will fix that issue.
October 30th, 2007 at 3:31 pm
[…] How to build ImageMagick and install RMagick with MacPorts on Mac OS X Leopard | Educate. Liberate. (tags: leopard ruby imagemagick rmagick mac rubyonrails osx rails macports gems guide) […]
November 1st, 2007 at 10:15 am
Thanks a TON!
November 7th, 2007 at 2:23 pm
I did the steps above, but this I got a “cannot find libMagick” error. Does anyone have any ideas?
jonathan@:~$ sudo gem install rmagick Password: Need to update 1 gems from http://gems.rubyforge.org . complete Building native extensions. This could take a while… ERROR: While executing gem … (Gem::Installer::ExtensionBuildError) ERROR: Failed to build gem native extension.
ruby gem_extconf.rb install rmagick
sh configure
Configuring RMagick 1.15.10 checking for gcc… gcc checking for C compiler default output file name… a.out checking whether the C compiler works… yes checking whether we are cross compiling… no checking for suffix of executables… checking for suffix of object files… o checking whether we are using the GNU C compiler… yes checking whether gcc accepts -g… yes checking for gcc option to accept ISO C89… none needed checking for gcc option to accept ISO C99… -std=gnu99 checking for gcc -std=gnu99 option to accept ISO Standard C… (cached) -std=gnu99 checking for ruby… /usr/bin/ruby checking for Magick-config… Magick-config checking for InitializeMagick in -lMagick… no configure: error: Can’t install RMagick. Can’t find libMagick or one of the dependent libraries. Check the config.log file for more detailed information. RMagick configuration failed with status 1.
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-1.15.10 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-1.15.10/gem_make.out
jonathan:~$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin:/usr/texbin:/opt/local/bin:/opt/local/sbin
I went to config.log and saw this part above when it exited:
ld: library not found for -ltiff collect2: ld returned 1 exit status configure:3243: $? = 1 configure: failed program was: | /* confdefs.h. / | #define PACKAGENAME “RMagick” | #define PACKAGETARNAME “RMagick-1.15.10.tar.gz” | #define PACKAGEVERSION “1.15.10″ | #define PACKAGESTRING “RMagick 1.15.10″ | #define PACKAGE_BUGREPORT “rmagick@rubyforge.org” | / end confdefs.h. / | | / Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern “C” | #endif | char InitializeMagick (); | int | main () | { | return InitializeMagick (); | ; | return 0; | }
Any help would be appreciated!
November 8th, 2007 at 10:47 pm
[…] man mit MacPort RMagick installiert, ist hier schön […]
November 12th, 2007 at 1:44 am
[…] nun auch RMagick für ein aktuelles Projekt brauchte, dachte ich ich nehm einfach die Anleitung von hier (ok steht ja schon im Posttitel ist für Leopard und nicht für Tiger) Das hat natürlich nicht […]
November 14th, 2007 at 11:24 pm
Hi!
Little bit different topic, but i tried to install rail mail, and the repo is not online! Could you make it alive?
Thanks!
November 16th, 2007 at 4:31 am
sudo port install tiff -macosx
yields:
Error: Target org.macports.configure returned: configure failure: shell command ” cd “/opt/local/var/macports/build/optlocalvarmacportssourcesrsync.macports.orgreleaseportsgraphicsjpeg/work/jpeg-6b” && ./configure –prefix=/opt/local –enable-shared –enable-static ” returned error 1 Command output: checking for gcc… no checking for cc… no configure: error: no acceptable cc found in $PATH
any ideas?
thanks!
November 16th, 2007 at 6:10 am
Problem solved - install the apple developers package.
November 21st, 2007 at 3:18 am
[…] This post might help too: http://nullstyle.com/2007/10/27/how-to-build-imagemagick-and-install-rmagick-with-macports-on-mac-os… […]
November 21st, 2007 at 6:20 pm
[…] http://nullstyle.com/2007/10/27/how-to-build-imagemagick-and-install-rmagick-with-macports-on-mac-os… Posted by Bradley Coudriet on Nov 21 2007 under web development, ruby, howto […]
December 27th, 2007 at 1:18 pm
Just a heads-up… After solving the GCC issues by installing Xcode 3.0, I had some other issues getting this installed due to a missing GNUTAR in /usr/bin. For some reason, it was not existent on my factory Leopard install. I can’t be sure that it wasn’t there and somehow removed, but copying getting a copy of TAR from a Tiger install and dropping it into /usr/bin did the trick. Also, be sure to symlink tar to gnutar (ln -s /usr/bin/tar /usr/bin/gnutar), as MacPorts looks for /usr/bin/gnutar
January 13th, 2008 at 5:22 pm
[…] Unfortunately it’s still a game of luck, pacience and preseverance. Luckily I followed the tutorial at onRails.org and managed to get things running after some time installing everything by hand from the source. I guess the alternative would be to use something like MacPorts to install RMagick. […]