Can't install anything and brew doctor just hangs #25167
Comments
Can you show the output of |
To be specific, you probably at some point ran If you have Xcode, you need to |
user$ xcode-select -print-path xcode-select: Error: No Xcode is selected. Use xcode-select -switch , or see the xcode-select manpage (man xcode-select) for further information. I installed only CLT. I tried sudo rm -rf /usr/share/xcode-select but there is no /usr/share/xcode-select and this didn't work. I've never run xcode-select -switch / before. |
Can you test running a tool via |
|
Even with I did: But |
Here's a thought. I installed |
|
OK, I found this thread about problems with the ever-maddening http://stackoverflow.com/questions/16546722/why-is-brew-doctor-stalling-on-mdfind I ran |
OK, I was able to install |
Do you have Spotlight disabled? |
No. I assume the reason |
We could/should perhaps make our |
We may implement a timeout at some stage. Please use a politer tone; we're trying to help and we're doing this in our free time. |
Can you explain? Does this mean that killing |
No, it won't damage anything. If |
No, |
Can you test some of the mdfind invocations that Homebrew uses?
|
I didn't realize that Homebrew used mdfind at all. I have indexing disabled via mdutil (and have always had it thus), and have never run into any issue like this. I ran the mdfind commands listed above and got no output. I hope this is not silently doing something bad to my brew installation. |
Would be awesome to just avoid using (and yes, I have disabled Spotlight). |
If you submit a pull request we'll consider it. |
It is also used as one of several fallbacks for locating Xcode on systems where it is not in the normal location. I don't think this code path is ever hit on recent-ish OS X/Xcode versions though. In other words, Homebrew will continue to function if you have Spotlight turned off, but we can't stop using it unless someone can prove there is another way to get the information we need that does not negatively impact performance and is portable across OS X versions. |
I see. Then I guess I'll have to keep Spotlight turned on.
Actually, I have the latest version of Xcode and running on Mavericks (up-to-date). |
Right, what I mean is that under 10.8/10.9 and Xcode 5, the mdfind fallback for locating Xcode is never reached. It is still used for XQuartz though. |
Sorry, I overlooked your previous message. I guess that's why I got the error messages. And I suppose that piping |
Basically any replacement has to be able to emulate not only
I don't think there is a viable alternative. |
If the trailing EOL is an issue, you can add This works pretty fast. |
I'm not going to replace the existing implementation, which has been refined and battle-tested over the course of two years to provide consistent results under as many OS X configurations as possible, with a series of calls to grep though a plist file unless it is actually fixing a reproducible bug. If you just don't want to have Spotlight enabled, that's fine, Homebrew already has fallbacks in place to cope with that. If mdfind is hanging, then we should figure out why, and how to fix it. But replacing code in Homebrew that works for 99.9% of users is not an acceptable way to go about that. |
Well, I was just answering to:
And as I said before:
And so did I. |
SolutionHere's an update. I finally solved the problem. At the risk of being accused of cross-posting, I think it bears repeating here since I started this thread. I posted this solution at brew doctor hangs at mdfind. I ran all the checks recommended in the posts and found multiple checks that caused When
This added Now |
Thanks @PacoH, your solution fixed the same issue for me ( |
I've only had Homebrew installed a short time and this is the second time this has happened. I try to install something, in this case gd, and absolutely nothing happens. Brew just hangs and has to be force terminated (ctrl-c). 'brew doctor' does the same thing and has to be force terminated. So there is no way for me to diagnose the install problem. It seems to me that if anything should run, it is the doctor. I successfully Updated Homebrew from ccf3d099 to 87172bd with no improvement.
brew --config gives:
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 87172bd
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 16-core 64-bit arrandale
OS X: 10.8.5-x86_64
This command hangs too BTW.
The last time this happened, I found a thread that implied that permissions were the problem so I manually changed permissions and ownership and rebooted and that solved it. This time permissions and ownership seem to be in order:
~ : user$ ls -l /usr/local
total 64
-rw-r--r-- 1 user admin 493 Dec 6 12:14 CONTRIBUTING.md
drwxrwxr-x 23 user admin 782 Dec 6 12:37 Cellar
drwxr-xr-x 9 user admin 306 Dec 2 13:06 Library
-rw-r--r-- 1 user admin 928 Dec 6 12:14 README.md
-rw-r--r-- 1 user admin 23510 Dec 6 12:14 SUPPORTERS.md
drwxrwxr-x 725 user admin 24650 Dec 6 12:39 bin
drwxr-xr-x 8 user staff 272 Sep 20 08:34 clamXav
drwxr-xr-x 5 user admin 170 Dec 6 12:34 etc
drwxrwxr-x 40 user admin 1360 Dec 6 12:39 include
drwxrwxr-x 105 user admin 3570 Dec 6 12:39 lib
drwxr-xr-x 23 user admin 782 Dec 6 12:39 opt
drwxrwxr-x 17 user admin 578 Dec 6 12:34 share
I tried rebooting but this time it didn't help.
None of the threads I have read really address this problem in my case. I have no idea how to procede from here. Homebrew is supposed to make installation from the command line easy. Instead it has been a nightmare for me. I really don't want to re-install everything each time this happens, nor do I want to install macports, so I want to learn exactly how to troubleshoot the problem and fix it. It looks like this will be a perpetual problem. Any help from someone who has solved this problem would be greatly appreciated. It seems that there are enough people having this problem that a sticky should be created about dealing with it.
The text was updated successfully, but these errors were encountered: