Cannot install Homebrew in Mac Sierra - ruby

I have a problem installing homebrew in mac sierra.
I followed the instructions from this link:
https://coolestguidesontheplanet.com/installing-homebrew-on-macos-sierra-package-manager-for-unix-apps/
This is the command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
The link exists but when I type this in the terminal, I encounter this error:
curl: (35) Server aborted the SSL handshake
Can anyone suggest a solution to this?
Many thanks, Ill appreciate any help.

https://raw.githubusercontent.com/Homebrew/install/master/install
Open the link in browser and save the file as install.rb.
Then run
ruby install.rb

I run into this issue, and it is caused by the network unstabitily.
My solution is:
Uninstall the homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Then install it again:
ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It works for me.

Have you tried xcode-select --install before that command? This solution may work on some systems.
Another potential issue is your curl maybe too old. Upgrade to 7.46+ may solve this. You have to build curl from scratch if so.
If nothing helps, and you really want to install brew without second thought, try adding --insecure after -fsSL.
At last, you can always pull the git repo and install manually.

Please use this to install homebrew in MacOS, previous one was deprecated.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Related

Unable to install homebrew in macos

I am trying to install homebrew using command /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" on my mac but I am getting this error:
HEAD is now at aa937b902 Merge pull request #11474 from cho-m/fix-tar-validation.
I'm using zsh and already installed the Xcode using the command xcode-select --install
What can I do to solve the error? Any help is appreciated.

Homebrew won't install on Big Sur (OS X 11.1) (M1)

I'm trying to install Homebrew on my OSx 11.1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
But I get the following error:
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version /bin/bash: not found
I found similar errors reported when trying to install Homebrew on old OSX systems, but this is not the case here. Does anyone have any idea what should I do?
Thank you!
maybe your curl is somehow linked to an older version(like macports). check the curl path and make sure you are using /usr/bin/curl.
I was not using the system tools here. which curl returned:
/opt/local/bin/curl
So I tried reducing the installer's PATH to the basics with the code below:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin /bin/bash -c "$(/usr/bin/curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Than added Homebrew to my PATH in /Users/hatvaniistvan/.profile with
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> Users/hatvaniistvan/.profile
eval $(/opt/homebrew/bin/brew shellenv)
This solved the problem and I managed not just install, but update homebrew as well.

how to uninstall homebrew using an arm based Mac?

I installed homebrew today. And I did something wrong so that my homebrew can't work now. Since I use an arm based mac, I am hard to find solution to uninstall my homebrew which installed in /opt/homebrew/.
To uninstall Homebrew, run the uninstall script from the Homebrew/install repository.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Download the uninstall script and run /bin/bash uninstall.sh --help to view more uninstall options.
Make sure your homebrew path is correct and then run the script:
echo $HOMEBREW_PREFIX #=> /opt/homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
See: https://github.com/homebrew/install#uninstall-homebrew

After uninstall brew cannot install it back

I could not update brew update. There was fatal error all the time. I di dnot use brew for years so I thought I'll uninstall it and then install back. I run
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
that went smoothly.
But after that when I try
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It tells that
-bash: /usr/local/bin/ruby: No such file or directory
When I read how to install ruby it suggests brew install ruby but I have just uninstalled it.
I've searched over google and tried a lot of different commands but nothing works.
It's often the case that bash remembers where executables were in your path and if those are later removed it gets very confused. There's ways of rehashing this to update that, but creating a new shell usually fixes the issue just the same.
Specifying the full path to the system Ruby will also work.

Mac - Can’t install Homebrew

I tried to install Homebrew like this:
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
It didn’t install correctly so I closed Terminal and tried again. Now it displays me the following message:
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
I tried to do that but without success. The following message is displayed:
brew: command not found
So, the problem is that Homebrew is installed but actually it is not installed. Any suggestions how to solve this problem? Thank you!
This seems to have resolved the issue for me
rm -rf /usr/local/Cellar /usr/local/.git
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Afterward, I can now
brew doctor
You may also find the gist linked to at the following page of use:
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md
The URL contained in the command you are using is not correct. Ruby will dump out lines of HTML and then fail. Use this command instead:
ruby -e "$(curl -fsSkL raw.github.com/Homebrew/homebrew/go/install)"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
this is work for me!
This worked for me:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
I removed the folder /usr/local/.git and homebrew installed just fine afterwards.
What was the message given when it didn't install correctly the first time? Is the brew binary present in /usr/local/bin ? If so, you probably just need to add it to your path, see: Error Installing Homebrew - Brew Command Not Found
Attempting to resolve the same issue, I found out that I had mistyped while making changes to my PATH. I did not have /usr/local/bin. I would then recommend running
$ echo $PATH
in terminal to see if you have the correct directories.You can also run
$ vi ~/.bash_profile
to see it and make changes if neccessary
If you cannot install by using curl try to open the install script from your browser, save it in a file called i.e brew_install.rb somewhere on your disk and run the script locally
ruby brew_install.rb
This worked for me.
Follow these steps
1 ==> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
2 ==> sudo rm -rf /usr/local/Homebrew/
sudo rm -rf /usr/bin/Homebrew/
3 ==> install brew
1 -- /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2 -- sudo chown -R $(whoami) /usr/local/var/homebrew
If get these error try below command
Error: Failed to link all completions, docs and manpages:
sudo chown -R $(whoami) /usr/local/*
then follow these commands
/usr/local/bin/brew update --force
This is the most recent one that works for me.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I found it here in case it is updated later. https://brew.sh/

Resources