Skip to content

Instantly share code, notes, and snippets.

@covard
Created January 31, 2017 21:44
Show Gist options
  • Save covard/3f27524c5736ac01194683f4c696f439 to your computer and use it in GitHub Desktop.
Save covard/3f27524c5736ac01194683f4c696f439 to your computer and use it in GitHub Desktop.

Private Gem Heroku

  1. Generate an OAuth token from GitHub

You only need to check the repo scope when configuring the token permissions

  1. Update Gemfile to use your private repository

gem 'private_repo', git: 'https://github.com/username/private_repo.git' 3. Configure bundler with your OAuth token

bundle config github.com <your_github_oauth_token> Now bundle and if everything works locally you are ready to deploy to Heroku!

  1. Finally add BUNDLE_GITHUB__COM to your Heroku environment
$ heroku config:add BUNDLE_GITHUB__COM=<your_github_oauth_token>
You now have a private gem installed on Heroku!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment