Skip to content

Instantly share code, notes, and snippets.

@adarsh
Last active December 10, 2015 20:18
Show Gist options
  • Save adarsh/4486943 to your computer and use it in GitHub Desktop.
Save adarsh/4486943 to your computer and use it in GitHub Desktop.
Installing chruby (and uninstalling rvm)

Installing chruby+ruby-build (and uninstalling rvm)

Motivation

  • RVM has given me a bunch of issues over time. Most recently, it wouldn't load for new shells. The cd hook also bothers me in a nonspecific way.
  • Also, we are testing chruby + ruby-build as an organization

System

  • OS X 10.7.5
  • MacBook Air

Uninstalling RVM

rm -rf ~/.rvm

Installing ruby-build

brew install ruby-build

It gives some rbenv-oriented instructions for adding stuff to your .profile (or .zprofile in my case). Ignored since I'm going to use chruby.

List all available rubies using ruby-build --definitions.

I installed my version using ruby-build 1.9.3-p327 ~/.rubies/ruby-1.9.3-p327. Compiling ensued.

The default search directory is ~/.rubies.

Installing chruby

brew install chruby

Post-install message asks me to put this in my .zshrc file: source /usr/local/opt/chruby/share/chruby/chruby.sh

Also this to auto-detect .ruby-version files source /usr/local/opt/chruby/share/chruby/auto.sh

Testing

I create a .ruby-version file in my project dir: echo "ruby-1.9" > .ruby-version

And one in my home directory to set the default ruby: echo "ruby-1.9" > ~/.ruby-version

In my project dir: gem install bundler bundle install

The bundle gave me some issues regarding ruby location, so I deleted everything in ~/.gem/ruby/ and it worked fine after.

Profit

Profit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment