huntout.me

Ruby Version Manager (RVM)

Mar 21, 2018

RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.

Install

brew install gpg2
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB\
## the backslash '\' bypasses a possible alias curl
\curl -sSL https://get.rvm.io | bash -s stable

Setting

# ~/.zshrc
export PATH="$PATH:$HOME/.rvm/bin"
source $HOME/.rvm/scripts/rvm

Usage

brew install gcc@4.9
echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > ~/.rvm/user/db
rvm list known
rvm install 1.9.3 --with-gcc=clang
rvm use 1.9.3