Wednesday, February 11, 2015

Upgrade Ruby version on your Mac OS X

Finally I got a 15'' Mac Pro as my working laptop, it is kind of Chinese new year gift :)
First, the OS embedded a Ruby 2.0 version, which is kind of out of date, so upgrade to the 2.2.0 is my first stuff to do with my Mac.
The main steps i follow is This
However, after doing that, it is not working properly on mine, so i will simplify my steps as following:
  1. Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install rbenv to help you manage ruby versions: brew install rbenv ruby-build
  3. Adding extra Path to ~/.bash_profile : export PATH=/Users/cchi/.rbenv/shims:$PATH
  4. Open Terminal-> preference -> Shell -> Startup : source ~/.bash_profile
  5. Check all existing package you can install : rbenv list -l
  6. Install Ruby 2.2.0: rbenv install 2.2.0
  7. Sets the global version to Ruby 2.2.0: rbenv global 2.2.0
  8. Check the ruby Version: ruby -v
Start to Taste your Ruby and Mac!!


Update: i found this link which is great steps and explanation to install  Ruby by rbenv:
https://cbednarski.com/articles/installing-ruby/