I am trying to install a ruby gem, but the installation process is stopped, because:
ld: file not found: /usr/local/lib/libfreetype.6.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I install this library? I checked the /usr/local/lib/
and the library is missing there.
EDIT:
I ran locate libfreetype.6.dylib and got:
/Applications/MAMP/Library/lib/libfreetype.6.dylib
/Applications/VLC.app/Contents/MacOS/lib/libfreetype.6.dylib
/Applications/XAMPP/xamppfiles/lib/libfreetype.6.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/X11/lib/libfreetype.6.dylib
/Applications/calibre.app/Contents/Frameworks/libfreetype.6.dylib
/Users/xxxxx/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib
/Users/xxxxx/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM
/Users/xxxxx/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents
/Users/xxxxx/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Info.plist
/Users/xxxxx/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Resources
/Users/xxxxx/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Resources/DWARF
/Users/xxxxx/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Resources/DWARF/libfreetype.6.dylib
/Users/xxxxx/rubydev/sharelock-staging/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib
/Users/xxxxx/rubydev/sharelock-staging/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM
/Users/xxxxx/rubydev/sharelock-staging/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents
/Users/xxxxx/rubydev/sharelock-staging/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Info.plist
/Users/xxxxx/rubydev/sharelock-staging/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Resources
/Users/xxxxx/rubydev/sharelock-staging/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Resources/DWARF
/Users/v/rubydev/sharelock-staging/magick-installer/freetype-2.4.3/objs/.libs/libfreetype.6.dylib.dSYM/Contents/Resources/DWARF/libfreetype.6.dylib
/opt/X11/lib/libfreetype.6.dylib
/usr/local/Cellar/freetype/2.4.10/lib/libfreetype.6.dylib
But why system doen't find the library?
What library are you trying to install? Could it by chance be ImageMagick? Also, if it's a RubyGem, why is the post tagged with homebrew?
Anyways, I got this error when installing ImageMagick, you need to symlink
/opt/X11/lib/libfreetype.6.dylib
to/usr/local/lib
.do this:
ln -s /opt/X11/lib/libfreetype.6.dylib /usr/local/lib/libfreetype.6.dylib
Your compiler is trying to link to an lib at a location that doesn't have the lib, however it seems that you have installed it with homebrew. Try running
ln -s /usr/local/Cellar/freetype/2.4.10/lib/libfreetype.6.dylib /usr/local/lib/libfreetype.6.dylib
to create one, or you can just use thewithout-freetype
flag to skip it.If you're using brew, you can:
Gabriel F. Engel's answer almost worked for me. I had to do the following change: