Skip to content

Instantly share code, notes, and snippets.

@pjbelo
Last active October 15, 2018 20:37
Show Gist options
  • Save pjbelo/338d3193d19a5537e74b0106553efaf9 to your computer and use it in GitHub Desktop.
Save pjbelo/338d3193d19a5537e74b0106553efaf9 to your computer and use it in GitHub Desktop.
RVM cheatsheet

Install RVM

https://rvm.io/rvm/install/

Update RVM

rvm get stable

Install Ruby dependencies

rvm requirements

List known rubies

rvm list known

Install Ruby

rvm install 1.9.3                # Latest known patch level
rvm install 1.9.3 -j 3           # Parallel compile, set to # of CPU cores
rvm install 1.9.3 --patch falcon # Use a patch (falcon for performance)
rvm install 1.9.2-p318           # Patchlevel 318
rvm install rbx --1.9            # Rubinius with 1.9 mode set as default

List all rubies and gemsets

rvm list         # List rubies only
rvm list gemsets # List rubies and gemsets
rvm gemset list  # List gemsets for current ruby

Selecting Ruby for work

rvm system                 # For system ruby, with fallback to default 
rvm use jruby              # For current session only
rvm use --default 1.9.3    # For current and new sessions
rvm use --ruby-version rbx # For current session and this project

RVM will automatically use a ruby and gemset when you cd to a project directory.

More help

Troubleshooting

This solved compiling problems with openssl:

rvm install ruby-2.5.1 --with-openssl-dir=/usr/local/opt/openssl

or:

rvm --debug requirements ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment