westonplatter / phashion

Ruby wrapper around pHash, the perceptual hash library for detecting duplicate multimedia files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to install gem - libjpeg not found

diziet opened this issue · comments

Hey -- I am having issues installing the gem via bundler (https://gist.github.com/diziet/6d0fe0f2341273729517)

mkmf.log says ld: library not found for -ljpeg
but I have libjpeg installed (made sure with brew)

( https://gist.github.com/diziet/a3092abbfa25c33c2af9 )

Other symptoms:

gcc -ljpeg
returns ld: library not found for -ljpeg

OSX 1.8.4, latest command line tools (https://gist.github.com/diziet/c32e0b043ec4432d546d), xcode, ruby-2.0.0-p247 via rvm.

I am baffled on why gcc can find libpng but not libjpeg.

Hmm. Have you tried install imagemagick?

brew install imagemagick
Warning: imagemagick-6.8.7-7 already installed

brew list: https://gist.github.com/diziet/c7ba04ee122803391334

I'm very much baffled!

Do you have libjpeg properly symlinked in the /usr/local/include directory? And possibly /usr/local/bin? Homebrew did this for me automatically.

Couple of suggestions - consider before executing:

  • do you have other GCC or C/C++/Objective confiugrations in your ~/.bashrc etc files?
  • try re-symlinking the libs via homebrew (may need to force the links).
  • try uninstalling/installing: imagemagick, libjpeg, libpng.

Issue was caused by a second brew being installed in the wrong place (in my case, /Users/alex/.rvm/bin/brew ) [no clue how that happened]

I was able to fix it by installing libjpg: /usr/local/bin/brew install libjpeg

bundle install worked fine from there