Heroku push rejected, failed to install gems via Bundler

ismaelsow picture ismaelsow · Jan 1, 2011 · Viewed 28.8k times · Source

I am struggling to push my code to Heroku. And after searching on Google and Stack Overflow questions, I have not been able to find the solution. Here is What I get when I try "git push heroku master" :

Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.3
       Unresolved dependencies detected; Installing...
       Fetching source index for http://rubygems.org/
       /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:300:in `open_uri_or_path': bad response Not Found 404 (http://rubygems.org/quick/Marshal.4.8/mail-2.2.6.001.gemspec.rz) (Gem::RemoteFetcher::FetchError)
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:172:in `fetch_path'
.
....

And finally:

FAILED: http://docs.heroku.com/bundler
 !     Heroku push rejected, failed to install gems via Bundler

error: hooks/pre-receive exited with error code 1
To [email protected]:myapp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:myapp.git'

Thanks for your help!

Answer

Jacob picture Jacob · Jan 2, 2011

I don't think it's a Rails version problem, nor is it specific to Heroku. (I hit the same problem today, when running bundle install on my local development machine, with Rails 3.0.3.)

Running bundle update locally, as Andrew suggested, fixes the issue.

Edit: As suggested in the comments: remember to git add ., git commit -m "message"