Ruby is installed on all WebFaction servers. For your convenience, several different Ruby versions are available. All servers have Ruby 1.9 through Ruby 2.2 installed. CentOS 6 servers also have Ruby 1.8.7 and Ruby 1.8.7 Enterprise Edition installed.

The default version of Ruby—the version of Ruby that runs when you run the ruby command—varies by server:

Operating system Default Ruby version
CentOS 6 1.8.7
CentOS 7 2.0

To identify the default version of Ruby on your server, run ruby --version.

To run a specific version of Ruby, run rubyX.Y, where X.Y is the Ruby version number. For example, to use Ruby 2.2, enter ruby2.2.

Installing Gems

You can install Ruby programs and libraries with the RubyGems package manager.

See also

To install gems for a specific Ruby on Rails application, see Installing Gems in our Ruby on Rails documentation.

To install a gem:

  1. Open an SSH session to your account.

  2. Create a directory for the gems. Enter mkdir -p {gems_dir} where gemsdir is the directory path (for example, $HOME/gemhome).

  3. Set the GEM_HOME environment variable. Enter export GEM_HOME=gems_dir and press Enter.

  4. Set the RUBYLIB environment variable. Enter export RUBYLIB=gems_dir/lib and press Enter.

  5. Set the PATH environment variable. Enter export PATH=gems_dir/bin:$PATH and press Enter.

  6. Enter gem install gem_name, where gem_name is the name of the Rub Gem to install, and press Enter.


    To use another Ruby version instead of the default, enter gemversion install gem_name, where version is an available version such as 1.9 or 2.1, and press Enter.

The gem is downloaded and installed. To use the gem’s executables, the gems_dir/bin directory must be in the PATH environment variable. Run export PATH=gems_dir/bin:$PATH in each session as needed, or add the statement to your .bash_profile file.

Table Of Contents

Search the documentation

Example: "configure email"
or "create database"