ruby 如何解决 RVM 安装过程中的“gpg: command not found”错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27041885/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 06:37:59  来源:igfitidea点击:

How to resolve "gpg: command not found" error during RVM installation?

rubymacoscommand-linervmgnupg

提问by JDillon522

I have a new mac pro (OS X 10.9.5) that I get to set up from scratch. I want to install RVM and the first thing it says to do is:

我有一个新的 mac pro (OS X 10.9.5),我可以从头开始设置。我想安装 RVM,它说要做的第一件事是:

Install mpapis public key (might need gpg2and or sudo)

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3

安装 mpapis 公钥(可能需要gpg2和或sudo

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3

When I tried I got:

当我尝试时,我得到:

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
zsh: command not found: gpg

I've tried to find a good guide on how to overcome this that also looks trustworthy but I've had no luck.

我试图找到一个关于如何克服这个看起来值得信赖的好指南,但我没有运气。

Can someone explain what gpgis, why I dont already have it, and how do I get it the right way.

有人可以解释一下gpg是什么,为什么我还没有它,以及我如何以正确的方式获得它。

回答by Jens Erat

GnuPG(with binary name gpg) is an application used for public key encryption using the OpenPGP protocol, but also verification of signatures(cryptographic signatures, that also can validate the publisherif used correctly). To some extend, you could say it's for OpenPGP what OpenSSL is for X.509 and TLS.

GnuPG(具有二进制名称gpg)是一个用于使用 OpenPGP 协议进行公钥加密的应用程序,但也用于验证签名(加密签名,如果使用正确,也可以验证发布者)。在某种程度上,您可以说它适用于 OpenPGP,就像 OpenSSL 适用于 X.509 和 TLS。

Unlike most Linux distributions (which make heavy use of GnuPG for ensuring untampered software within their package repositories), Mac OS X does not bring GnuPG with the operating system, so you have to install it on your own.

与大多数 Linux 发行版(大量使用 GnuPG 以确保其软件包存储库中的软件不受篡改)不同,Mac OS X 没有随操作系统一起提供 GnuPG,因此您必须自己安装它

Possible sources are:

可能的来源是:

  • Package manager Homebrew: brew install gnupg gnupg2
  • Package manager MacPorts: sudo port install gnupg gnupg2
  • Install from GPGTools, which also brings GUI applications and integration in Apple Mail
  • 包管理器Homebrewbrew install gnupg gnupg2
  • 包管理器MacPortssudo port install gnupg gnupg2
  • GPGTools安装,它还带来了 GUI 应用程序和 Apple Mail 中的集成

回答by rderoldan1

As the instruction said "might need gpg2"

正如指令所说 "might need gpg2"

In mac, you can try install it with homebrew

在 mac 中,您可以尝试使用 homebrew 安装它

$ brew install gpg2 

回答by valmsmith39a

Thisworked for me

对我有用

$brew install gnupg

回答by Reza Malik

You can also use:

您还可以使用:

$ sudo gem install rvm

It should give you the following output:

它应该为您提供以下输出:

Fetching: rvm-1.11.3.9.gem (100%)
Successfully installed rvm-1.11.3.9
Parsing documentation for rvm-1.11.3.9
Installing ri documentation for rvm-1.11.3.9
1 gem installed