Heroku push hanging on “fetching gem metadata from

2019-07-09 03:57发布

问题:

My deployment is stuck on fetching gem metadata from rubygems every time I deploy.
It worked this morning, had problems this afternoon and now it's not working again.
We tried from somewhere else and from other computers with the same result.

It works fine locally I can update from rubygems without a problem.

Visual:

Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 764 bytes, done.
Total 9 (delta 7), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.2.1
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/
Updating https://github.com/epetre/negative-captcha.git
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..

[IT HANGS HERE FOREVER]

Anyone has a clue?

回答1:

Fixed by adding bundler to the gem file and forcing a version

gem 'bundler', '1.2.1'


回答2:

Ok, fixed for good I think. Turns out it only works when explicitly specifying the last versions of heroku and bundler. The strange thing is that it can bundle without the explicit versions locally but not when deploying to heroku.

gem 'heroku', '2.33.0'
gem 'bundler', '1.2.1'


回答3:

For me changing the protocol to fetch gem fixed the problem.

I changed https://github.com/epetre/negative-captcha.git to git://github.com/epetre/negative-captcha.git in gem file. Bundled it and pushed to heroku and it works.