Reputation: 21
Using Mac OS Sierra (Version 10.12.1).... following is the error I get ... Please help
Amits-MacBook-Pro:~ amitsubba$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/lib
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/lib
Password:
mkdir: /usr/local/lib: Not a directory
Failed during: /usr/bin/sudo /bin/mkdir -p /usr/local/lib
Amits-MacBook-Pro:~ amitsubba$
Upvotes: 2
Views: 2679
Reputation: 3512
I just ran into the same problem and it was because I already had a simlink at usr/local/bin
drwxr-xr-x 2 michael.huff admin 64 Mar 18 11:40 Caskroom
drwxrwxrwx 2 michael.huff admin 64 Mar 18 11:40 Cellar
drwxrwxr-x 2 michael.huff admin 64 Mar 18 11:40 Frameworks
drwxrwxrwx 2 michael.huff admin 64 Mar 18 11:40 Homebrew
lrwxr-xr-x 1 michael.huff admin 24 Feb 25 16:54 bin -> /usr/local/jamf/bin/jamf
drwxrwxr-x 2 michael.huff admin 64 Mar 18 11:40 etc
drwxrwxr-x 2 michael.huff admin 64 Mar 18 11:40 include
drwxr-xr-x 3 michael.huff admin 96 Feb 28 23:32 jamf
drwxr-xr-x 2 root wheel 64 Mar 18 14:09 lib
drwxrwxr-x 2 michael.huff admin 64 Mar 18 11:40 opt
drwxrwxr-x 2 michael.huff admin 64 Mar 18 11:40 sbin
drwxrwxr-x 3 michael.huff admin 96 Mar 18 11:40 share
drwxrwxr-x 3 michael.huff admin 96 Mar 18 11:40 var
All I had to do was sudo rm /usr/local/bin
and then try reinstalling brew again.
Upvotes: 0
Reputation: 21
You need to delete lib file in /usr/local:
cd /usr/local
rm lib
Also give full permissions to directories Homebrew and Cellar in the same directory:
sudo chmod 777 Homebrew/
sudo chmod 777 Cellar/
And then run below commands:
sudo chown -R $USER /usr/local; brew update
rm -rf /usr/local/.git
Now try to install homebrew using ruby as usual.
Upvotes: 2