Dowanlod zip of entire project from Github https://github.com/appium/appium
Unzip and open its directory.
I use ~/Documents/appium-master for this demo, you can choose yours, but DO remeber to change the path to yours.
cd ~/Documents/appium-master/sample-code/examples/ruby
Setup samples and install necessary gems:
gem install bundle #install bundle
bundle update #install gems