Fixes the bundle install problem on CentOS 6.x.

Previous approach relied on gem already being installed.  That's non-optimal with CentOS 6.x as it forces the installation of system Ruby 1.8.7.

This pull request installs RubyGems from the official upstream git, and makes some some of the other things a bit more robust too.

Only tested on CentOS 6.x.  May need adjustment for other platforms.