You are here

Ruby

Supported Versions

There are usually two versions of Ruby supported on DICE. The default (as invoked by the ruby, gem, etc.) will usually match the default for the DICE distribution, but others will be available. Here's a summary of installed versions:

DICE SL7

Version

Command

Location

Notes

2.0.0

ruby

/usr/share/ruby/

Default version, base libraries plus gem

2.5.0

scl enable rh-ruby25 <...>

/opt/rh/rh-ruby25/root/

Must be enabled via SCL to use; includes gem, bundler, rake, rdoc etc.

DICE-provided modules

Ruby has a straightforward and powerful mechanism allowing users to install their own modules through the gem system. We'd encourage users to use this wherever possible. For more complex setups we'd recommend the bundler system provided by Ruby 2.5, which enables full sets of library dependencies to be prepared.

However we understand not all modules can be built without assistance and we'll try to provide build dependencies where native compilation is needed.

We'd also ask that you get in touch if your libraries are required for teaching, or where it would be useful for them to be pre-distributed (for example if the build is particularly large or or time-consuming).

Installing modules yourself

In every case we'd recommend use of the gem command. Modern versions should know to install into your home directory using just:

$ gem install packagename

Though if you receive permissions errors attempting to write to system locations (i.e. anywhere not within your home directory), older versions of ruby might require:

The gem commands place code into ~/.rvm, ~/.gem and, if ~/bin is in your shell $PATH, executables will be placed there, too. It's worth pointing this out as this spread can make cleanup / uninstallation tricky.

We've seen issues combining multiple versions of ruby concurrently. Where you have ruby 2.0 libraries which you'd like to retain but also need to use/install newer SCL-provided ruby libraries, you may need to clear your Ruby environment variables: