Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have installed OS X Lion and I was trying to resolve error libxml2 missing for Ruby programming purpose. I tried to install latest version of Libxml2 that is libxml2-2.8.0

Because of incompatibility of this version Mac is throwing errors while opening XCode, Chrome and some other application with the error.

Dyld Error Message:
Library not loaded: /usr/lib/libxml2.2.dylib
Referenced from: /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
Reason: no suitable image found.  Did find:
   /usr/lib/libxml2.2.dylib: mach-o, but wrong architecture
   /usr/local/lib/libxml2.2.dylib: mach-o, but wrong architecture
   /usr/lib/libxml2.2.dylib: mach-o, but wrong architecture

What should I do ? How should I remove libxml2 2.8.0 version.?

Please reply

share|improve this question
    
How did you install the newer version? Macports? Homebrew? Also, which version of Xcode do you have installed? And did you install the command line tools that are optional in the Xcode downloads section? Knowing this will give us a little more insight on how to help you out. –  de_an777 Jun 20 '12 at 14:05
    
Yes,libxml2 was installed using ./configure and make. The problem was that there was Python-2.7.3 dependency for it, which was ignored by me :( .Now I reinstalled Lion and fixed the problem –  shailesh_srk Jun 21 '12 at 13:20
add comment

1 Answer

up vote 2 down vote accepted

You can do either of

  1. remove /usr/local/lib/libxml2.2.dylib, copy a working libxml2.2.dylib from another Mac with the same OS X version and recreate the symlinks to look like the directory listing below

  2. reinstall OS X Lion on top of the existing installation and reapplying all the system updates.

  3. get libxml2.2.dylib from your backup and apply option 1

PS: I managed to do the same thing with one of the more essential libraries a few months ago, leaving only option 2 (because nothing useful worked anymore). With hindsight I probably could have booted from DVD to apply option 1, but I would still have needed a trusted source for the library because the DVD was for 10.7.0.


pse@Fourecks:~$ ll /usr/lib/libxml2.*
lrwxr-xr-x  1 root  wheel       15 Feb 12 11:51 /usr/lib/libxml2.2.7.3.dylib@ -> libxml2.2.dylib
-rwxr-xr-x  1 root  wheel  2321840 May 10 20:34 /usr/lib/libxml2.2.dylib*
lrwxr-xr-x  1 root  wheel       15 Feb 12 11:51 /usr/lib/libxml2.dylib@ -> libxml2.2.dylib
share|improve this answer
    
Thanks! Reinstalled Lion and worked :) –  shailesh_srk Jun 21 '12 at 13:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.