It is preferred to use the default Ruby interpreter provided with the system. Ruby is in the repositories of all common linux distributions and can be installed easily using their package manager. When installing Ruby this way, install also the interactive Ruby shell "irb" and the development package for Ruby. On a Debian-based linux distribution, the three packages needed are "ruby", "irb" and "ruby-dev".
However, on computers where it is not available (or when newer version is needed), it is possible to install Ruby in user space.
Ruby can be installed using the Conda package manager as well. To install current ruby into a new environment named "ruby", use:
conda create -n ruby
conda activate ruby
conda install conda-forge::ruby
Another option is to use the Ruby Version Manager. It is, howewer, more complicated than it used to be, and may require admin privileges to install the libraries ruby depends on.