Installing Ruby

The essential ingredient

Ruby interpreter is available for all major platforms. By that I mean you can program in Ruby using Windows, Mac OS or your Linux distribution of choice. At the time of writing this chapter, the latest Ruby version is 3.0.0. If you’re starting out then the exact version doesn’t really matter so you could use 2.7.2 if 3.0.0 is not available on your platform.

I’m not going to cover the installation proccess in detail but I’m going to give you some tips on installing Ruby.

Windows

On Windows, I recommend using RubyInstaller to install Ruby. Make sure to install the Ruby+DevKit package which will allow us to install gems (Ruby name for libraries created by other people) without too much fuss.

Mac OS

You should use Homebrew to install asdf on MacOS. Once you have asdf installed you can install any Ruby version using the instructions below:

quintasan@demonbane:~$ asdf plugin add ruby
quintasan@demonbane:~$ asdf install ruby 2.7.2

Linux

Use asdf on Linux to install any Ruby version. Once you have asdf installed you should be able to install any Ruby version by issuing the following commands:

quintasan@demonbane:~$ asdf plugin add ruby
quintasan@demonbane:~$ asdf install ruby 2.7.2

Verifying installation

We can verify that we have installed Ruby successfuly by asking the interpreter to tell us it’s version:

quintasan@demonbane:~$ ruby --version
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]

There’s only one more thing we need to install to get rolling really quickly - a proper debugger.