MindRave
MindRave

Reputation: 148

Heroku not installing private gem locally

I have an issue with installing a private gem on heroku. I have managed to install it once, with the oauth token, and the deploy goes just as it should. The Gemfile line goes like this:

gem 'personal_gem', "0.0.3", git: "https://TOKEN:[email protected]/personal_gem.git", branch: :master

It all goes as planned the first time around. I go back to my project all happy, make a few changes and then deploy again. And I get this amazing message:

Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: /tmp/build_b69276ed81314bd83fe154e89deceb82/vendor/ruby-2.2.4/lib/ruby/2.2.0/rubygems/dependency.rb:315:in 'to_specs': Could not find 'personal_gem' (>= 0) among 159 total gem(s) (Gem::LoadError)`

Boom.

I believe I've tried it all. Bumping up the gem version, all the "git", "github" combinations in the Gemfile I could think of.

Heroku gem list does NOT list the gem!

Heroku bundle install DOES list the gem.

On my machine, installations go just fine. There are no local gem installations of this gem to conflict with the one I'm pushing online, it shows the github link properly.

The most bizarre thing is that the first install goes as it should. Also, if I change the ruby version and push, it also goes just fine. But not on subsequent pushes on the same ruby version.

I'm under impression that for some reason the gem isn't installed on heroku. However, the site + gem functionality work as intended online.

This is some X-Files stuff here, and any help/pointers are really appreciated!

Upvotes: 0

Views: 300

Answers (1)

neo
neo

Reputation: 4116

generate a token GitHub:

https://github.com/settings/tokens

then set it on Heroku:

heroku config:set GITHUB_AUTH_TOKEN=<my-read-only-token>

more info here:

https://gist.github.com/hone/b0c0093374097313ab7f

Upvotes: 1

Related Questions