So I'm always forgetting how to do this! I guess I'm only ever updating Ruby versions every now and then.
$ chruby
will display your installed rubies and show you the version you're currently using in your shell.
ruby-2.1.2
ruby-2.2.1
ruby-2.3.1
ruby-2.3.3
ruby-2.4.1
* ruby-2.4.4
ruby-2.5.0
$ ruby-install ruby 2.4.5
will download the version you're after, just pass in the version number as the second argument (after ruby).
Gotchas
- Make sure the version is installed in
~/.rubies
and you can see a directory for the newly installed version - Restart the shell so that your new version is loaded
Switch to the version you're after once it's installed by running chruby with the version number $ chruby 2.4.5
FWIW I came across an issue where
readline
was out of date in the Ruby version I was on (an older version).You sometimes need to update Rubies so that stuff with work! I just re-installed, and good to go!