18

I just ran the Homebrew script as described in the installation page. I then ran brew doctor in Terminal, and it returned several errors. I'm not sure how to fix those errors, please help.

brew doctor

Error: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1
Error: You have Xcode 4.2, which is outdated.
Please install Xcode 4.3.
Error: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libcdt.5.dylib    /usr/local/lib/libcgraph.6.dylib    /usr/local/lib/libgraph.5.dylib    /usr/local/lib/libgvc.6.dylib    /usr/local/lib/libgvpr.2.dylib    /usr/local/lib/libpathplan.4.dylib    /usr/local/lib/libxdot.4.dylib
Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/libcdt.pc    /usr/local/lib/pkgconfig/libcgraph.pc    /usr/local/lib/pkgconfig/libgraph.pc    /usr/local/lib/pkgconfig/libgvc.pc    /usr/local/lib/pkgconfig/libgvpr.pc    /usr/local/lib/pkgconfig/libpathplan.pc    /usr/local/lib/pkgconfig/libxdot.pc
Error: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    2to3

Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.

3 Answers 3

27

I managed to get it up and running after much Googling and fiddling.

First, you need to make the directories writable using "chown".

sudo chown $(whoami) /usr/local/share/man/de
sudo chown $(whoami) /usr/local/share/man/de/man1

Then install Xcode 4.3 from the App Store, and install command line tools from Xcode->Preferences->Downloades->Components. Then set a valid path to Xcode 4.3.

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

There are some unexpected dylib and .pc files from GraphViz. It's probably safe to delete them directly but I chose to back them up instead in case other applications break. To back them up:

mkdir -p ~/brew-backup/lib/pkgconfig/
mv /usr/local/lib/*.*.dylib ~/brew-backup/lib/
mv /usr/local/lib/pkgconfig/*.pc ~/brew-backup/lib/pkgconfig/

Finally, amend the system PATH so that /usr/local/bin appears ahead of other paths.

export PATH=/usr/local/bin:/usr/local/sbin:$PATH

Check that there is no more error by running

brew doctor

Update brew to keep package information up to date, and you're ready to go.

brew update
3
  • From my experience, you can safely ignore most brew doctor errors, except for when you really can't install something.
    – slhck
    Jun 12, 2012 at 14:29
  • 1
    Shouldn't those directories be owned by root, though? Aug 13, 2012 at 2:20
  • Copy and paste all the directories, set to a variable by: directories="PASTE HERE". echo "$directories" | while read line; do echo "$line"; sudo chown $(whoami) "$line"; echo; done; Feb 1, 2013 at 21:40
3

Definitely back up those dylib's and pc's. Not having them around breaks graphviz (especially the python bindings). Copy them back to their directories once you're all set.

If you forget to back them up, and graphiz stops working with "Image Not Found" errors on libraries, just reinstall the graphviz application from the website (http://www.graphviz.org/Download_macos.php).

It seems like the name of the game here is ignoring those particular brew doctor warnings.

1

I would "white list" the .dylib files here:

nano +128 /usr/local/Library/Homebrew/cmd/doctor.rb

adding:

"libcdt.5.dylib", 
"libcgraph.6.dylib", 
"libgraph.5.dylib", 
"libgvc.6.dylib", 
"libgvpr.2.dylib", 
"libpathplan.4.dylib", 
"libxdot.4.dylib", 

and the .pc files here:

nano +163 /usr/local/Library/Homebrew/cmd/doctor.rb

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .