Switching to rvm from rbenv
After struggling to get OSX to use a new version of ruby using rbenv, I decided it was finally time to switch to RVM. The reason I am switching is not only because rbenv was not working, but also because I am very used to the syntax since I use NVM daily. It was easier for me to remember to type ‘rvm use 2.2.3’ than it was to type ‘rbenv global 2.2.3’ or ‘rbenv local 2.2.3’
Here is what I did to switch.
Uninstall rbenv
First I removed the binary with brew.
brew remove rbenv
Then I removed it from my .bash_profile located in my home directory. You can edit it with your favorite editor, and remove the lines that refer to rbenv. I removed “if which rbenv & /dev/null; then eval “$(rbenv init -)”; fi” from my .bash_profile file.
I then removed all the files that rbenv had used, they were located in one folder under ~/.rbenv
rm -rf ~/.rbenv
Installing RVM
I followed their instructions right from the website, and that i probably the best method, but just in case, these are the steps I took. You may need gpg2 to be installed if you do not already have it installed.
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
Install RVM stable with ruby:
\curl -sSL https://get.rvm.io | bash -s stable --ruby
After that, you can open a new terminal window, and then install the version of ruby you want. I wanted 2.2.3.
rvm install 2.2.3
Using RVM
The most basic command that you will need is ‘use.’ It selects which version of ruby you are using.
rvm use 2.2.3
I also updated Setting up a new mac for development to incorporate RVM.