OSX is well know because it has, out of the box, things like a PHP interpreter and also a Ruby interpreter. The bad side about that is usually this versions are old.
In this post I’ll provide the steps to update your ruby version using homebrew.
Fist, install homebrew if you don’t have installed
Then, use this commands to install ruby
brew install rbenv ruby-build
rbenv global 2.3.1
Finally, rbenv will change the ruby environment to your desired version. So, to select the right for ever, add this into your bash_profile or your zshrc
That will select the right version for ruby.