Search code examples
ruby-on-railsrubyosx-lionhomebrewrmagick

OS X Lion, ImageMagick and RMagic - how to install?


I am trying to install ImageMagick and RMagic, because they don't work after the OS X Lion upgrade. When I ran

brew install imagemagick

I got the error

Error: You must `brew link libpng' before imagemagick can be installed

But when I run brew link libpng as is mentioned in the error message, I'll get:

Error: You must `brew link libpng' before imagemagick can be installed
Radek-Macs-MacBook-Pro-3:sharelock-staging radek$ brew link libpng
Linking /usr/local/Cellar/libpng/1.5.13... Warning: Could not link libpng. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/libpng/1.5.13/include/pnglibconf.h
/usr/local/include/pnglibconf.h may already exist.
/usr/local/include may not be writable.

How to fix this issue? I am solving the RMagic thing two days without any success... this is a pure nightmare...


Solution

  • I've had this complaint from brew before. It was solved in my case by unlinking, then relinking; that is, running brew unlink "libname", then brew link "libname", substituting for "libname" the name of the software that isn't linking right; in your case, "libpng".