Ruby

Ruby is a programming language, it is required for software like Rails, passenger, and GitLab.

Emerge
Install :

make.conf
One can activate specific ruby implementations by adding  to. Please note: setting the RUBY_TARGETS variable may overwrite the implementations set by the systems base profile.

Multiple Ruby implementations in can be installed in parallel. The RUBY_TARGETS variable picks the implementations from USE_RUBY (which is set ebuilds depending on Ruby) and (re)compiles packages with support for each selected implementation.

Select a Ruby slot with eselect
Ruby is slotted in Portage, to view which installed version slot the system is currently using, run:

To change the selected slot, issue:

Adding or removing Ruby implementations
To add a new Ruby version, or remove an old version, first adjust the Ruby target variable in. For example, if upgrading from Ruby 2.2 to Ruby 2.3, add  to the RUBY_TARGETS variable:

Or for example, if removing Ruby 2.2, remove  from the RUBY_TARGETS variable:

It is safe not to add and remove targets in one step.

Next, ask Portage to rebuild the @world set with the new Ruby target list:

After the emerge completes, update the slot to the newly installed version (2.3 in this case) using as mentioned above.

Finally, as long as no packages are still using the old version, it should be removable by asking Portage to do a dependency clean:

Installing a test implementation on an otherwise stable system
Starting with Ruby 2.2 we are now using the stable mask mechanism to keep Ruby 2.2 on testing until it is ready to be unmasked. If you want to use ruby23 on an otherwise stable system, you need to apply the following changes:

For further information please see the instructions for Python.

External resources

 * Codecademy's Ruby course
 * http://iwanttolearnruby.com/