Can't install Homebrew: Can't find the certificate

1

1

Attempted to install Homebrew with the following command:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Received this error:

fatal: unable to access 'https://github.com/Homebrew/homebrew/': SSL: Can't find the certificate "kgreenwood" and its private key in the Keychain.

Attempted to work on something else, discovered that I couldn't clone from git with HTTPS anymore. I generated an SSH keypair (disclaimer: I know almost nothing about certificates) and can now clone using SSH URLs.

I assume the issue is that the Homebrew installation command uses an HTTPS url. Is there some way I can force it to use SSH instead? I've tried "untar anywhere" alternative solution in their guide (typing mkdir homebrew && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C homebrew in /usr/local) but I keep getting:

brew: command not found

kgreenwood

Posted 2015-08-14T08:55:09.933

Reputation: 11

Try building it from source by adding the --build-from-source flag when calling brew install. – kkmonlee – 2015-08-14T10:30:00.510

Regarding the brew: command not found error you have to add /usr/local/bin in your PATH. In your ~/.bashrc add the following: export PATH="/usr/local/bin:$PATH". – bfontaine – 2015-08-14T10:45:05.023

Answers

0

According to this post, most likely it's misconfiguration of your ~/.gitconfig.

Check for sslCert and sslVerify options and adjust the settings accordingly or remove them.

kenorb

Posted 2015-08-14T08:55:09.933

Reputation: 16 795

0

you can use ssh instead, as always on github.

clone it into any location.

git clone git@github.com:Homebrew/homebrew 

then adapt PATH. insert into .bashrc

export PATH=/path/to/homebrew-dir/bin:$PATH

then, do a brew update and brew doctor.

Schwertspize

Posted 2015-08-14T08:55:09.933

Reputation: 335

Regarding the “any location” part it’s always better to clone it in /usr/local. Homebrew will work if it’s installed in another place but some formulae won’t be available as bottles (= pre-compiled binaries). – bfontaine – 2015-08-14T10:46:25.877

Oh.... yes, I missed that – Schwertspize – 2015-08-14T11:13:26.607

Wow of course. I was making that way harder than it had to be. I convinced myself that because I didn't know what "tarball" or "ruby -e "$(curl -fsSL etc" meant that it must have been more complicated than just cloning it from github. I originally had export PATH="/usr/local/bin:$PATH" in my .bash_profile. Just tried putting it in .bashrc but am still getting brew: command not found. Does the order matter? I have a few other things in there from RVM and Heroku Toolbelt. – kgreenwood – 2015-08-14T14:17:09.333

if you use mdfind -name brew, what is the output? I don't think it's /usr/local/bin. more like /usr/local/homebrew/bin but you have to try. – Schwertspize – 2015-08-14T15:27:43.067

ps: tarball is a tar bundles archive (mostly .tar.gz the curl etc... inside the brackets downloades an install script and ruby -e executes it. but that is one of the reasons why I like homebrew more than MacPorts. you can simply clone a git repo and fix path. brew update does not much more than save changes and git pull – Schwertspize – 2015-08-14T15:33:16.890

mdfind -name brew gives me the following output: /usr/local/homebrew/share/doc/homebrew/brew-tap.md /usr/local/homebrew/share/doc/homebrew/brew-test-bot-failed-jenkins.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-failed-pr.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-failed-test.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-for-core-contributors-block.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-for-core-contributors-console.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-for-core-contributors-tabs.png ... – kgreenwood – 2015-08-17T09:33:32.863

/usr/local/homebrew/share/doc/homebrew/brew-test-bot-for-core-contributors-trigger.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-passed-jenkins.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-passed-pr.png /usr/local/homebrew/share/doc/homebrew/brew-test-bot-triggered-pr.png /usr/local/homebrew/share/man/man1/brew.1 /usr/local/homebrew/share/doc/homebrew/The-brew-command.md /usr/local/homebrew/share/doc/homebrew/Querying-Brew.md ... – kgreenwood – 2015-08-17T09:36:26.630

/usr/local/homebrew/share/doc/homebrew/Brew-Test-Bot.md /usr/local/homebrew/share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md /usr/local/homebrew/bin/brew /usr/local/homebrew/Library/brew.rb /usr/local/homebrew/Library/Homebrew/manpages/brew.1.md /usr/local/homebrew/Library/Formula/brew-pip.rb /usr/local/homebrew/Library/Formula/brew-gem.rb /usr/local/homebrew/Library/Contributions/brew_zsh_completion.zsh /usr/local/homebrew/Library/Contributions/brew_bash_completion.sh /Applications/rubystack-2.0.0-29/rvm/scripts/functions/requirements/osx_brew – kgreenwood – 2015-08-17T09:36:35.543