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
Heroku's git (version 1.7) doesn't support using e-mail as username for Github's repositories.
You must use your Github username.
Also, Heroku's git doesn't support using an oauth token.
Hopefully Heroku will upgrade their git soon, so they can continue making my life easier :-)