Skip to content

Instantly share code, notes, and snippets.

View forsbergplustwo's full-sized avatar

Bjørn Forsberg forsbergplustwo

View GitHub Profile
@forsbergplustwo
forsbergplustwo / gist:ee60395c51607eb847916d7caee85137
Created November 6, 2019 10:22 — forked from sebboh/gist:f1dfe4f096746c45f3e9ea06a09743a0
Installing a Gem on Heroku from a Private GitHub Repo

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

This method does not add your OAuth token to Gemfile.lock. It uses bundle config to store your credentials, and allows you to configure Heroku to use environment variables when deploying.

  1. Generate an OAuth token from GitHub