Can't Install Ruby Rvm on Ubuntu 16.04 Due to Gpg Bug

Can't install Ruby rvm on Ubuntu 16.04 due to gpg bug

After trying many ways. I did succeed to install rails as follows:

$ \curl -sSL https://get.rvm.io | bash
$ source /home/<user>/.rvm/scripts/rvm
$ rvm -v
$ rvm install ruby
$ ruby -v
$ sudo apt-get install rubygems
$ gem update
$ sudo apt-get install ruby-dev zlib1g-dev liblzma-dev build-essential patch
$ rvm gemset list
$ gem install rails
$ rails -v

Where "user" is my username

RVM install on Ubuntu failing (error importing public key) [Kodign VM]

It turns out that the problem was indeed fixed by file permissions. There are a few things I want to point out however.

The solution for this problem relies in changing the permission of several files in cascade.

For a more complete answer on permissions, I recommend this discussion, suggested by Maxim Pontyushenko:

  • gpg: WARNING: unsafe ownership on configuration file, $gpg --fingerprint on Ubuntu9.10

Now for the solution itself. You must changed the ownership and the read/write permissions of the following files, in the following order:

  1. /home/[username]/.gnupg/gpg.conf
  2. /home/[username]/.gnupg/pubring.gpg
  3. /home/[username]/.gnupg/trustdb.gpg

You must change the permissions on these 3 files in this specific order.

Additionally, do not run the gpg command using sudo.
If you do it, you will be stuck on a error regarding safe file permissions to which i was not able to find any solution.
Instead, run the gpg command using your username.

I hope this helps the next person having problems. Kudos++ to all who commented!

can't install ruby with rvm on windows11 wsl

Solution i used

i ended up upgrading wsl to wsl 2
using wsl --set-version Ubuntu-18.04 2 from a powershell terminal

i had to delete the corrupted ruby files for this to work but the first run gave me the location of the files. and a couple of rm -rf <corrupted folders> allowed the process to complete.

Be warned this is a relatively long process took me approx 15mins per run.

after the process i was able to run the install of ruby 3.0.0 with no problem.

thank you NotTheDr01ds for putting me on track with a solution

Unable to install Ruby on Rails on Ubuntu 16.04 LTS

If you install rvm without sudo privileges, everything else should work as expected

If you have rvm installed, remove it using

rvm implode

or

rm -rf ~/.rvm

Then install rvm using

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable

Then install ruby with

rvm install 2.3.0

Use whichever version you wanna install.

Now go ahead and install rails

gem install rails

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

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 publisher if used correctly). To some extend, you could say it's for OpenPGP what OpenSSL is for X.509 and 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.

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


Related Topics



Leave a reply



Submit