How to get a specific "commit" of a gem from github?
Any of these should work:
gem 'rails', :git => 'git://github.com/rails/rails.git', :ref => '4aded'
gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => '2-3-stable'
gem 'rails', :git => 'git://github.com/rails/rails.git', :tag => 'v2.3.5'
Source: How to install gems from git repositories
A shorter version:
gem 'rails', :github => 'rails/rails', :ref => '4aded'
Or, in Ruby 1.9+
gem 'rails', github: 'rails/rails', ref: '4aded'