I have tryed different approaches to use a Github private repository reference in a Rails application Gemfile.
1) Gemfile:
gem \'my_gem\', :git
Heroku runs an older Git version, which unfortunately doesn't fully support the auth part of the URLs.
You can work around this by adding the dummy password supplied by GitHub. So instead of using:
https://#{github_oauth_token}@github.com/me/my_gem.git
Use:
https://#{github_oauth_token}:x-oauth-basic@github.com/me/my_gem.git