In this post we learn to manage Ruby versions with the Ruby Version Manager or RVM.
Ruby is a useful language and we use it extensively. As developers we need the ability to quickly move between installed versions of Ruby as necessary to work against. This need was recently highlighted by the release of OSX Mavericks which implemented core changes that could affect development environments adversely.
We manage different versions of ruby with the Ruby Version Manager. We will explore how to:
- Install RVM.
- Find available versions of Ruby.
- Use RVM to install Ruby.
- Completely remove the installed RVM and Ruby.
This demonstration is performed on OSX Mavericks, but the concepts will easily translate to a Linux user.
Install RVM
- Install RVM.
$ curl -sSL https://get.rvm.io | bash -s -- --auto-dotfiles
- Exit Your Terminal and restart it!!!
- Verify the installation.
$ rvm -v
- Find available versions of Ruby.
$ rvm list known
- Use RVM to install Ruby version 2.1. Use the –force flag to require recompilation of the gems.
$ rvm install 2.1 --force
- Tell the system to use the installed Ruby as the default.
$ rvm use 2.1 --default
Purge RVM
- Completely remove the installed RVM and Ruby.
$ rvm implode
- Manually remove RVM references from the respective personalization files:
$ ~/.profile, $ ~/.bashrc $ ~/.zshrc $ ~/.bash_profile $ ~/.zlogin