February 10, 2017

How to Upgrade the System Ruby on Macintosh

Apple releases software updates pretty regularly. It usually ships older versions of software. I need to run the latest version of ruby. I go through the following steps to upgrade it to the latest version:

  1. Install rbenv by checking it out using git clone https://github.com/rbenv/rbenv.git ~/.rbenv
  2. Append $HOME/.rbenv/bin to your path
  3. Refresh your shell session
  4. Remove the preexisting ruby versions -- yes, all of them -- from ~/.rbenv/versions, rm -Rf ~/.rbenv/versions/*
  5. Install the latest ruby version to ~/.rbenv/versions/
  6. Overwrite the files in /usr with symlinks pointing to ~/.rbenv/versions/<latest-ruby-version> -- find .rbenv/versions/<latest-ruby-version>/ -depth 1 -exec ln -sf {} /usr \;
  7. set the default ruby version globally to your newly rbenv-installed version. And you're now done... Have fun and make rubies

No comments:

Post a Comment