Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 486
Nicholas.V Avatar asked Jul 11 '14 05:07

Nicholas.V


1 Answers

I finally fixed the problem with a surprisingly simple solution:

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

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

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

Voilà! GhostScript now works.

like image 164
Nicholas.V Avatar answered Nov 13 '22 09:11

Nicholas.V