Ruby

Notitle

Ruby is a dynamic, reflective, object-oriented, general-purpose programming language with support for multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.

Ruby is available as a module on Apocrita.

Usage

The ruby module provides two main binaries:

  • ruby - The Ruby language
  • gem - The package manager for Ruby

ruby help option:

module load ruby
ruby --help

ruby man page:

module load ruby
man ruby

gem help option:

module load ruby
gem --help

RubyGems

The RubyGems software allows you to easily download, install, and use ruby software packages. The software package is called a gem and contains a packaged Ruby application or library.

Installing a Ruby package using gem

Gems can be installed via the gem install command:

gem install <package_name>

Your gem package will be installed under $HOME/gems

Important Note

The default gem installation location will be your home directory. If you like to change your gems installation location set the GEM_HOME variable to your new gem installation path.

Listing installed gems

This command will list all the locally installed Ruby gems.

gem list

More information about the gem package management tool can be found here.

References