4

Trying to install Homebrew on Lion. When I do:

/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" 

I get this error:

dyld: Library not loaded: /opt/local/lib/libidn.11.dylib
Referenced from: /usr/local/bin/curl
Reason: image not found

I had MacPorts installed previously but uninstalled it and completely removed /opt/local I also removed /opt/local from my PATH

Any idea why this error is happening?

Callmeed
  • 4,972
  • 5
  • 34
  • 49

5 Answers5

8

You built and installed curl into /usr/local/bin, but it linked against your MacPorts-installed libidn. You should delete /usr/local/bin/curl. You may also want to double-check everything else in /usr/local/bin to see if they have the same problem.

You may also need to check things in /usr/local/lib in case they link against MacPorts-installed libraries too. For example, curl may have a /usr/local/lib/libcurl.dylib that might link against stuff from /opt/local/lib.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347
  • Is there any easy way to check for other things that may be linking to MacPorts libraries? – Callmeed Feb 17 '12 at 00:36
  • 2
    @Callmeed: You can use `otool -L path` to check what libraries `path` links against. If you check `otool -L /usr/local/bin/curl` it should say that it's linked against something inside `/opt/local/lib`. – Lily Ballard Feb 17 '12 at 00:48
  • Yes please, if there is a fix. I have a similar issue with a library that I removed, by deleting the folder, and now ffmpeg is complaining about it. – nycynik Jul 31 '12 at 16:52
4

For me, running brew install libidn did the trick

DerLola
  • 3,858
  • 1
  • 19
  • 25
2

Try $ brew reinstall curl , the curl dependency is reinstalled

lupguo
  • 1,525
  • 13
  • 13
0
cd /usr/local/opt/libidn2/lib/
ln -s libidn2.4.dylib libidn2.0.dylib
-7

The following fixed the specific issue for me:

rm -f /usr/local/bin/curl
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)

If you already have an older homebrew installed:

rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

Stash any unbrewed files:

cd /usr/local/Library && git stash && git clean -f

brew doctor:

Install xcode cli tools from http://connect.apple.com.

Andy Hayden
  • 359,921
  • 101
  • 625
  • 535