You are here

Ruby

Printer-friendly versionPrinter-friendly version

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.

See our Software Collections page for more general details on SCL availability.

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:

$ gem install --user-install packagename

See gem help install for full details on this command.

Multiple versions / interactions

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:

$ unset GEM_HOME; unset GEM_PATH; unset RUBY_VERSION
$ scl enable rh-ruby25 bash
$ gem install <packagename...>

See the documents provided by man ruby (particularly the ENVIRONMENT section) and gem help environment for more details on these interactions.

Last reviewed: 
15/08/2018

System Status

Home dirs (AFS)
Network
Mail
Other services
Scheduled downtime

Choose a topic