After using RVM for a while I have make the switch to RBENV. They both work perfectly fine, but people have preferences and mine if RBENV. These are the steps required to make the change:
1. Uninstall RVM
You cannot run RVM and RBENV together, you have to choose one or the other. RVM is really easy to remove, it comes with a command to self district and completely remove itself from your system:
This did 99% of the work for me … but for some reason it could not remove all the files from ~/.rvm so either go ahread and remove it afterwards or running the implode command with sudo would probably do the trick as well.
1.1 Uninstall Gems (from system ruby)
I had a lot of gems installed on my system (the base ruby installation) from before I started using RVM. You can remove them all with the following command:
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
2. Install RBENV
The easiest way to install rbenv is with homebrew (http://mxcl.github.io/homebrew/), so I suggest you head over and get that installed if you don't already. Once you have that sorted out use brew to install the following two apps:
brew install rbenv
While rbenv is your typical ruby version switcher, ruby-build allows you to easily install any ruby version.
2.1 Install RBENV continued
For some reason rbenv did not install properly for me. The files were install but my bash profile was not updated. The following two lines need to be in your bash profile.
2.2 Installing Rubies
You will need to install each version of ruby you intend using.
Use 'rbenv install --list' to see a list of all available versions, then 'rbenv install <version>' to install that version.
3 Prepare Your Projects
Your projects probably have a few '.rvmrc' files laying around which are now obsolete.
Do this for each of your projects:
- run 'rbenv local <version>' where <version> is the version listed in 'rbenv versions'. This will generate a '.ruby-version' file in the local directory which rbenv will use to determine which ruby version to use for this project.
- remove '.rvmrc' file if it exists