#

Ruby

NOTE: This documentation describes the new lmod module system on the cluster, currently in opt-in phase. See this page for details. In particular you need to activate the lmod system with the following command: source new-modules.sh

The Ruby programming language, known primarily for it's strength as a web platform, has a growing list of useful packages for scientific programming, visualization, and data management.

Use rbenv to setup a personal Ruby environment

The Odyssey cluster provides Ruby 1.8.7, the default install for CentOS 6. If you'd like a new version of Ruby, or would like to install additional gems, a self-contained environment can be constructed using rbenv.

First, install rbenv and ruby-build in your home directory and enable it. From the website:

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ test %a_%a_ext

You may need to logout and log back to get the PATH changes to apply

Second, install the version of Ruby that you'd like to use. rbenv install -l will get you a list of available Ruby versions and rbenv install <version> will install the version you choose.

Use rbenv to install a new version of Ruby and activate it

The rbenv global command can be used to "activate" your new Ruby install so that it operates as the default. This setting of the "global" Ruby will persist between sessions; you do not have to set this in your .bashrc. It can be overridden temporarily or on a per-directory basis.

Once you have the version of Ruby you would like to use, you can install any Ruby gem that you find useful.

Install a Ruby gem using the currently active environment

CC BY-NC 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. Permissions beyond the scope of this license may be available at Attribution.