Skip to content

Instantly share code, notes, and snippets.

@benhoskings
Created January 10, 2014 00:46
Show Gist options
  • Save benhoskings/8344953 to your computer and use it in GitHub Desktop.
Save benhoskings/8344953 to your computer and use it in GitHub Desktop.
Ben's guide to painless ruby switching with chruby
1) Latest brews.
$ brew update
2) Install packages.
$ brew install chruby ruby-install selecta
3) Load chruby when the shell inits.
echo >> ~/.zshrc
if [ -d /usr/local/opt/chruby ]; then
. /usr/local/opt/chruby/share/chruby/chruby.sh
. /usr/local/opt/chruby/share/chruby/auto.sh
fi
5) Build as many rubies as you like:
$ ruby-install # List installable rubies
$ time ruby-install ruby 2.1.0
$ time ruby-install ruby 1.9.3-p484
6) Choose a default ruby:
echo $(ls -1 ~/.rubies | selecta) > ~/.ruby-version
7) Restart shell
8) Choose a directory-specific ruby:
echo $(ls -1 ~/.rubies | selecta) > ./.ruby-version
cd ..
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment