Skip to content

Instantly share code, notes, and snippets.

@nachozt
Last active January 19, 2022 18:03
Show Gist options
  • Save nachozt/e99dc00f27c23c8849603b52bbcee88e to your computer and use it in GitHub Desktop.
Save nachozt/e99dc00f27c23c8849603b52bbcee88e to your computer and use it in GitHub Desktop.

Ruby Version Manager

  • RVM: which is the most established, but also the most intrusive in terms of shell modifications. It manages gemsets and installs different ruby versions. Most of that functionality has been surpassed by Bundler.
  • rbenv: which is lower impact. Does not install ruby versions. It only manages different ruby versions. But it also do things like overriding cd so that it can switch rubies “magically”. They also install shims of commands like gem, ruby, and others that dynamically look up the available Rubies.
  • chruby: even lighter than rbenv.
  • frum: https://www.sitepoint.com/ruby-version-managers-macos/

Now using FRUM

OLD

CHRUBY

  • Install ruby-install
brew install ruby-install
  • Install chruby
brew install chruby
  • add the following line to the ~/.bashrc or ~/.zshrc file:
source /usr/local/opt/chruby/share/chruby/chruby.sh

Auto-Switching

If you want chruby to auto-switch the current version of Ruby when you cd between your different projects, simply load auto.sh in ~/.bashrc or ~/.zshrc:

source /usr/local/share/chruby/chruby.sh 
source /usr/local/share/chruby/auto.sh

chruby will check the current and parent directories for a .ruby-version file.

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