尝试安装 RoR 时无法安装 RVM

尝试安装 RoR 时无法安装 RVM

我正在尝试在我的系统上安装 RoR。我正在关注数字海洋教程。当我尝试\curl -L https://get.rvm.io | bash -s stable使用此命令安装 RVM 时,出现以下错误:

gpg: Signature made Tuesday 31 March 2015 03:22:13 AM IST using RSA key ID BF04FF17
gpg: Can't check signature: public key not found
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).

GPG signature verification failed for '/home/suraj/.rvm/archives/rvm-1.26.11.tgz' - 'https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc'!
try downloading the signatures:

    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

or if it fails:

    command curl -sSL https://rvm.io/mpapis.asc | gpg --import -

the key can be compared with:

    https://rvm.io/mpapis.asc
    https://keybase.io/mpapis

答案1

这是 RVM 最新版本中引入的安全功能,因此您必须手动导入密钥。按照错误提示进行操作:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

gpg命令会联系公钥服务器并请求与给定 ID 关联的密钥。在本例中,我们请求的是 RVM 项目的密钥,该密钥用于对每个 RVM 版本进行签名。有了 RVM 项目的公钥,我们就可以验证要下载的 RVM 版本的合法性,该版本使用匹配的私钥进行签名。

答案2

在我的例子中,问题是因为 .gnupg 目录是 root 所有者。解决方案是使用以下命令设置正确的用户和组chown命令。

答案3

Lafitte 为我指明了正确的方向。我想详细阐述他的回答,但没有要点可以评论。因此,以下是我的贡献:

sudo chown -R `whoami`:somegroup ~/.gnupg

显然,用您的用户所属的组替换“somegroup”。

相关内容