ImageMagick / GhostScript - dyld: Library not loaded: /usr/local/lib/libjbig2dec.0.dylib

ghostscript, imagemagick, macos, osx-mavericks

Solution

I finally fixed the problem with a surprisingly simple solution:

I tried `brew install jbig2dec` which returned `Warning: jbig2dec-0.11 already installed`.

I then checked to see if it it was linked: `brew link jbig2dec` which returned `Warning: Already linked: /usr/local/Cellar/jbig2dec/0.11`

I then ran `brew unlink jbig2dec && brew link jbig2dec` to relink it.

Voilà! GhostScript now works.

Problem

When I run `convert file.pdf` or `gs` command in terminal I get the following error: ``` dyld: Library not loaded: /usr/local/lib/libjbig2dec.0.dylib Referenced from: /usr/local/bin/gs Reason: image not found ``` I installed imagemagick and ghostscript using homebrew: ``` brew install imagemagick brew install gs ``` I have tried solutions in related questions such as reinstalling, relinking etc but I just can't get it to work. I have also tried: ``` brew uninstall libtool brew install libtool --universal brew unlink libtool && brew link libtool --force ``` Homebrew, libtool, imagemagick and ghostscript are all up to date and I am running the latest version of Mavericks. Any ideas on how to fix this problem?

Original source