Skip to content

Instantly share code, notes, and snippets.

@peteyoung
Last active December 30, 2015 04:49
Show Gist options
  • Select an option

  • Save peteyoung/7778622 to your computer and use it in GitHub Desktop.

Select an option

Save peteyoung/7778622 to your computer and use it in GitHub Desktop.
chruby setup and usage

Setup and Use chruby

Initial Setup

brew install chruby

add to .bashrc:

# source /usr/local/opt/chruby/share/chruby/chruby.sh
CHRUBY_SETUP_SCRIPT=/usr/local/opt/chruby/share/chruby/chruby.sh
if [[ -efs $CHRUBY_SETUP_SCRIPT ]]
   then
       . $CHRUBY_SETUP_SCRIPT
       export RUBIES=(/opt/rubies/*)
       chruby 1.9.3-p429
fi

Adding rubies with ruby-build

Install ruby-build

brew install ruby-build

List available ruby builds

ruby-build --definitions

Build and install a ruby

sudo mkdir /opt/rubies/
sudo ruby-build -v 1.9.3-p429 /opt/rubies/1.9.3-p429
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment