teaching machines

Installing a Newer Ruby with RVM

February 9, 2016 by . Filed under cs330, specifications, spring 2016.

My department’s Linux machines don’t have a very new Ruby installed (1.8.7, which was released in 2008 and which has since been retired by the Ruby community). This old version is missing a number of useful features, like lookaround assertions in regular expressions! Instead of upgrading the system-wide Ruby, they recommend that each individual install their own custom Ruby using RVM. Here are the steps to do so:

  1. Log in to one of the thingies.
  2. Learn how to copy and paste into the shell from your local operating system. Or get good at typing.
  3. Install the RVM developer’s public key:
    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  4. Install RVM:
    \curl -sSL https://get.rvm.io | bash -s stable

    This places some scripts inside your home directory and adds some lines to your shell’s configuration files to load up RVM when you first login.

  5. Install a more recent version of Ruby:
    rvm install 2.3.0
  6. Test that the expected version of Ruby is running:
    ruby --version

Let me know if you encounter errors.