It seems that the community is split between whether they should use
rbenv to manage different versions of Ruby and Rails.
I decided to give them both a try and found more success with rbenv. In the end, they're both very similar but
rbenv seemed a little more straight forward.
You might even want to learn a little about bundler.
If you know that you'd rather use
rvm instead, here is my tutorial on how to do it.
Here's my article on how to install Ruby and Rails using Mac, Homebrew, and Ruby Version Manager.
Step 0 - Install
Homebrew is a package manager for stuff other than Ruby or Rails. You'll need this to install
Step 1 - Install
brew install rbenv
Step 2 - Install Ruby
brew install ruby-build
Configure your environmental
~/.bash_profile by pasting this single line of code into Terminal.
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Refresh your terminal. This is the same as restarting terminal.
Double check that rbenv has been installed.
Standing on the shoulders of giants
Install whichever ruby version you need. One trick is to look at what version Heroku supports and just copy them.
rbenv install 2.x.x
Every time you install something, you need to rehash
Switch your computer to start using Ruby 2.x.x
rbenv global 2.x.x
Step 3 - Update
If you're on Mac OS X, you simply need to update gem.
gem update --system
Step 4 - Install
Bundler was added to Rails 3 to manage gems.
gem install bundler
Remember that every time you install something, you need to rehash it.
Step 5 - Install
gem install rails --version 4.2.3 --no-ri --no-rdoc
Step 6 - Install a database
Step 7 - Pick an IDE
- RubyMine is awesome if you're familiar with IntelliJ or PyCharm.
brew cask install rubymine
- RadRails is good for developers familiar with Eclipse.