There are many ways to install Ruby on Rails but the current trend is to use a package manager to keep things in order. The best two options for package management are rvm and rbenv. This entry will use RVM.
RVM includes an autolibs[^1] option to identify and install components needed for your operating system. In our case, we aim to enforce homebrew to be our package manager instead of RVM's default enable.
The reason for the \ before curl in order to avoid possible version conflicts.
Step 5 - Double check your work
If you have rvm installed, this should say "rvm is a function"
rvm | head -n 1
Step 6 - Maintenance
Keep your rvm up-to-date.
rvm get stable --autolibs=enable --auto-dotfiles
rvm get stable --autolibs=homebrew
Removing RVM entirely
Implode removes all traces of RVM from your system (except for changes such as ~/.bash_profile). You may need to do this if you choose rbenv to manage your ruby packages.