gpg2 command not found even when gpg2 is installed on mac? (trying to install rvm)
Asked Answered
U

3

24

So I installed brew:

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

and then I installed gnupg2 and gnupg like so:

brew install gnupg gnupg2

I tried to install both again seperately like so:

brew install gpg2    
brew install gnupg

and it said both are already installed. (wanted to confirm it).

Now, when I try to install RVM like so:

gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

my MAC says

-bash: gpg2: command not found

Any idea why?

Undrape answered 27/1, 2019 at 18:50 Comment(2)
Maybe try typing just gpg ... instead of gpg2, it might be symlinked that way.Sniffle
I had the same problem and nothing seemed to work, so eventually I did the following: 1) opened /usr/local/bin, 2) looked up the gpg symlink there, 3) duplicated it, 4) renamed the copy "gpg2", and everything started working fine again.Tybi
B
21

On Mac, installing with brew already gives you gpg2, but it's named as gpg, so you need to create an alias or a symlink. A symlink worked for me.

brew install gnupg

Get where is gpg located

which gpg

In my case it was /usr/local/bin/gpg

Then create symlink:

ln -s /usr/local/bin/gpg /usr/local/bin/gpg2
Brassy answered 10/11, 2021 at 21:12 Comment(1)
Just for additional clarity you simply need to copy whatever path which gpg output as the PATH in: ln -s PATH/gpg PATH/gpg2Hbomb
W
8

after

brew install gpg2

execute

gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
Wilkie answered 23/4, 2019 at 16:31 Comment(2)
interesting, I see gpg: keyserver receive failed: No route to host Any explanation as to how your solution works and what else is going on here?Bombardier
I've just posted a solution here #54801774Gagger
B
0
  1. brew install gpg2
  2. curl -sSL https://rvm.io/mpapis.asc | gpg --import -
  3. curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -

This works for me

Bonner answered 29/10, 2022 at 10:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.