Upgrade to Ruby 2.6 on Linux

February 26, 2019


To be ready for Rails 6 upgrade we needed to install Ruby 2.5 or above, so we went for ruby 2.6.1

Up till now we had been running Rails 5.2.2 on Ruby 2.4.1.

So here are the steps we took:-

1) update ruby version in /.ruby-version file

2) Intall Ruby 2.6

$ sudo apt-get update
$ rvm get stable --autolibs=enable

    gpg: Signature made Sun 30 Dec 2018 10:44:46 GMT using RSA key ID 39499BDB
    gpg: Can't check signature: No public key
    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/me/.rvm/archives/rvm-installer' - 'https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc'! Try to install GPG v2 and then fetch the public key:

        gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

    or if it fails:

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

    the key can be compared with:

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

    NOTE: GPG version 2.1.17 have a bug which cause failures during fetching keys from remote server. Please downgrade or upgrade to newer version (if available) or use the second method described above.

    bash: return: _ret: numeric argument required

So tried this but failed:

$ gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

then tried this but this failed too:

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

FORGET upgrading rvm!

Now install ruby 2.6.1:

$ rvm install ruby-2.6.1

( wait a good while to complete )

$ rvm gemset list

gemsets for ruby-2.6.1 (found in /home/me/.rvm/gems/ruby-2.6.1)
=> (default)
   global
$ rvm gemset use global
$ gem list
$ gem outdated
$ gem update
$ gem install nokogiri
$ bundle update

Thats it. Check that all tests pass.

© 2019 Keith P | Follow on Twitter | Git