Homebrew complains about a non-Homebrew "pkg-config" in my PATH

1

I've just installed Homebrew onto my machine, after which I ran brew doctor which threw up two warnings.

I didn't appear to have the command line tools for Xcode installed, which I have now. The second warning is:

Warning: You have a non-Homebrew 'pkg-config' in your PATH:
/opt/sm/pkg/active/bin/pkg-config

`./configure` may have problems finding brew-installed packages using
this other pkg-config.

What can I do to remedy this?

sam

Posted 2012-11-28T20:57:46.937

Reputation: 3 411

Where does /opt/sm, or the pkg-config come from? Do you have any other package manager installed perhaps (I'm not familiar with those, just Homebrew)? Do you remember installing it there? – slhck – 2012-11-28T21:04:05.180

no idea, its a brand new machine, i decided to add all the programs on by hand instead of from a backup to get rid of all the stuff i didnt need – sam – 2012-11-28T21:12:09.007

the only thing i could think of is it may have came bundeled with either osx, xcode, xcode command line tools, or when i installed rails from railsinstaller.org – sam – 2012-11-28T21:14:23.143

It's the Rails installer that put itself in /opt/sm/, including the pkg-config installation, which now takes precendence over the default pkg-config from Homebrew in /usr/local/bin. Do you see any modifications the Rails installer might have made to ~/.bash_profile, ~/.profile, /etc/paths.d/, etc. to modify the path? – slhck – 2012-11-28T21:25:44.727

sorry slhck, were should i be look for those ? – sam – 2012-11-28T21:41:53.927

Those are paths to actual files. Since you installed Homebrew I assumed you were a little familiar with the command line, sorry. You have to open them, e.g. with open -e ~/.bash_profile, or use the Finder to go to /etc/paths.d through Go » Go to Folder…. It's very likely the Rails installer has set its path somewhere there. – slhck – 2012-11-28T21:50:39.033

thanks for help with this slhck, ive ran open -e ~/.bash_profile and open -e ~/.profile with both i got "The file ______ dose not exits" i also navigated to /ect/paths.d but the folder was empty does that sound correct ? – sam – 2012-11-28T22:12:31.217

Ah, that simply means Rails installer modified the path somewhere else. Last try: In the terminal enter touch ~/.bash_profile, then try opening it again, and add the line: export PATH=/usr/local/bin:$PATH – now restart Terminal and run brew doctor again. – slhck – 2012-11-28T22:17:22.440

no luck unfortunately, i get the same warning. Although i was just reading up this article on engine yard - (https://www.engineyard.com/blog/2012/railsinstaller-for-os-x/) were it says that with the stuff railinstaller installs "OS/X users won’t need to use a different package manager such as Homebrew or MacPorts for most common gems." Although i not quite sure how you would install gems

– sam – 2012-11-28T22:33:31.600

Through gem install presumably? That should work as usual. Do you need Homebrew for anything else? I mean, you could just ignore the warning until you run into actual compilation problems. – slhck – 2012-11-29T04:49:02.230

yeh, i think thats what ill end up doing. Thanks for the help – sam – 2012-11-29T14:33:03.737

No answers