Skip to content

Instantly share code, notes, and snippets.

@prusswan
Forked from akdetrick/rvm-to-rbenv.md
Created September 2, 2018 03:49
Show Gist options
  • Save prusswan/066c2dbfb8e0d6899ccbf7acaaad8233 to your computer and use it in GitHub Desktop.
Save prusswan/066c2dbfb8e0d6899ccbf7acaaad8233 to your computer and use it in GitHub Desktop.
Guide to switching to rbenv bliss from RVM hell

RVM to rbenv

Why? @sstephenson explains it best here.


1) remove RVM from your system

This should get rid of the rvm dir and any installed rubies:

$ rvm implode
$ gem uninstall rvm
$ rm ~/.rvmrc
$ rm /etc/rvmrc

2) remove any remaining traces of RVM

Remove anything RVM-related from your PATH in:

  • .profile
  • .bash_profile
  • .bashrc

3) install rbenv

Using homebrew:

$ brew update
$ brew install rbenv ruby-build

4) install rubies for rbenv

# list all available versions:
$ rbenv install -l

# install a Ruby version:
$ rbenv install 2.0.0-p247

Note: if you install a new version of ruby or a new gem and something isn't working, run $ rbenv rehash

5) switching ruby versions in rbenv

There are two easy ways of switching versions.

Specifying the right version of ruby for individual projects

Lots of ruby projects (including sassquatch) include a .ruby-version file. This file tells rbenv which ruby version to use for the directory.

Manually switching rubies

# show versions currently installed and indicate current version
$ rbenv versions
# set ruby version for a specific dir
$ rbenv local 1.9.3-p327
# set ruby version globally
$ rbenv global 1.9.3-p327

6) install the bundler gem

You should install the bundler gem because it's a nice way to manage gem dependencies in a project. For example, here's the Gemfile in sassquatch that bundler uses to manage gem dependencies for the projcet.

$ sudo gem install bundler

7) never fight with RVM again

enjoy your new lease on life

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