Installing a gem from a private GitHub repo (Heroku)

Installing a gem from a private GitHub repo (Heroku)

I have a private repository on Github that I want to use. I deploy my app to Heroku. How can I specify a private repository as the source on my gemfile? I imagine it wouldn't be enough to simply say

gem "mygem", :git=>"my github address"

As per suggestion from Heroku tech support, the easiest way to do this is by putting the username and password into the URL, as in Basic HTTP Auth, e.g.

gem "my_gem", :git => 'https://my_username:my_password@github.com/my_github_account/my_repo.git', :ref => 'revision_no'

On Heroku:

Get your OAuth Token from GitHub

To authenticate Bundler to GitHub, you will need an OAuth token. You can follow this guide to create a new one.

Setting up your credentials

To set up your credentials, use bundle-config: Then, add your GitHub credentials to Heroku:

Then run the command :- 

heroku config:add BUNDLE_GITHUB__COM=github_username:github_password

Install your dependencies 

gem "mygem", git: "https://github.com/user/mygem.git"

After adding gem then run bundle

Comments

Popular posts from this blog

CARRIERWAVE - UPLOAD ANY MEDIA (AUDIO , VIDEO AND IMAGE ) FILE IN RAILS

RAILS: UPLOADING PHOTOS VIA AMAZON S3 AND PAPERCLIP (UPLOADING FILES TO S3 IN RUBY WITH PAPERCLIP)

SELECT COUNTRY WITH STATE AND IT'S CITIES RAILS

psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

SEARCHING USING AJAX IN RAILS

UNINITIALIZED CONSTANT PAPERCLIP::STORAGE::S3::AWS

UPLOAD ANY MEDIA FILE IN RAILS USING PAPERCLIP

Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.

HOW TO CALL RAILS API FROM SIMPLE HTML PAGE.