5

I'm getting

   FAILED: http://devcenter.heroku.com/articles/bundler

! Heroku push rejected, failed to install gems via Bundler To git@heroku.com:... ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to ………….. (see bottom for full listing)

This is an application that is currently working on heroku, but heroku won't allow git push heroku master to update the code.

However, if I clone the code to a new folder and do a heroku create to create a new app with seeded data, the new app works fine. However, I don't want to use the new app because I have data on the functioning app I want to persist.

There seems to be something on the existing app or gems that is resisting being updated. I wouldn't think data could stop gems from being installed, so I don't know what to do.

Suggestions?

Does "Heroku push rejected, failed to install gems via Bundler" mean that the problem is in updating a gem, or is that a red herring?

Thanks.

$ git push heroku master Counting objects: 536, done. Delta compression using up to 2 threads. Compressing objects: 100% (125/125), done. Writing objects: 100% (391/391), 1.08 MiB, done. Total 391 (delta 262), reused 373 (delta 251)

-----> Heroku receiving push
-----> Removing .DS_Store files
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
       Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
       Unresolved dependencies detected; Installing...
       Using --without development:test
       Windows Gemfile.lock detected, ignoring it.
       You have modified your Gemfile in development but did not check
       the resulting snapshot (Gemfile.lock) into version control
   You have added to the Gemfile:
   * source: rubygems repository http://rubygems.org/
   * rails (= 3.0.5)
   * haml
   * haml-rails
   * sqlite3-ruby
   * devise (= 1.1.5)
   * omniauth
   * declarative_authorization
   * will_paginate (= 3.0.pre2)
   * nifty-generators
   * acts-as-taggable-on
   * acts_as_commentable
   * aws-s3
   * jquery-rails
   * rspec-rails
   * annotate
   * faker (= 0.3.1)
   * hpricot (= 0.8.3)
   * ruby_parser
   * paperclip (~> 2.3)
   * formtastic (~> 1.2.3)
   * hirb
   * kaminari
   * rspec (= 2.5.0)
   * webrat
   * factory_girl_rails (= 1.0)
   * cucumber
   * mocha
   FAILED: http://devcenter.heroku.com/articles/bundler

! Heroku push rejected, failed to install gems via Bundler

To git@heroku.com:... ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to …………..

Rick Heller
  • 81
  • 1
  • 3
  • I think this is they key: `Windows Gemfile.lock detected, ignoring it.`. Have a look at the question "Does Bundler work on Windows?" here: http://www.engineyard.com/blog/2011/bundler-pro-tip/. Also: http://stackoverflow.com/questions/5954236/why-wont-heroku-accept-my-gemfile-lock-in-windows – matt Jul 19 '11 at 17:53
  • @RickHeller please accept Codeglot's answer, because you're obviously happy with it. – opyate May 21 '12 at 19:49

5 Answers5

7
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control

This means that you have added gems to you gemfile but have not updated to. The Gemfile.lock is out of sync with this file.

You need to update your bundle.

Run this command in console in your app's directory: bundle

Then do git push heroku

And you should be good to go.

**Nuke the app and start over.

gem install taps #install taps
heroku db:pull   #pull your data to your local machine

rm -rf .git #remove your git repo 
git init    #create a new repo
git add .   #add all the files
git commit -m 'master' #commit as master

heroku create #create a new heroku app
heroku rename myapp #rename the app
git push heroku master #push to heroku

heroku db:push #push your data to heroku

And that should get a new app up.

thenengah
  • 42,557
  • 33
  • 113
  • 157
  • Thanks, but it seems to be more complicated than that. Perhaps something has gotten corrupted. At some point, one of us put the Gemfile.lock in the .gitignore file, and that is probably what started the trouble. What I just did is to delete the line from the .gitignore, delete Gemfile.lock, run bundle install to regenerate it, add the Gemfile.lock and commit, and push to heroku again. I'm getting the same message. So something is messed up. Is there some way I can tell Heroku and git to start from scratch with the gems? – Rick Heller Jul 19 '11 at 00:40
  • So you did run `bundle` and it created the bundle without errors? – thenengah Jul 19 '11 at 00:41
  • Yes, whether I run bundle or bundle install, I get no error, and a message like Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. – Rick Heller Jul 19 '11 at 01:19
  • Ok. So the next thing that I would do is remove the gem.lock file. That is problem corrupt. – thenengah Jul 19 '11 at 01:20
  • BTW make sure that `Gemfile.lock` is actually removed. – thenengah Jul 19 '11 at 01:22
  • I tried that, but I still get a message that is falseYou have modified your Gemfile in development but did not check the resulting snapshot (Gemfile.lock) into version control – Rick Heller Jul 19 '11 at 01:55
  • Just trying to cover all the basics here: `gem update bundler` – thenengah Jul 19 '11 at 02:01
  • I did that, and it didn't make a difference.I did up the version number. $ gem list bundler *** LOCAL GEMS *** bundler (1.0.15, 1.0.10) I notice heroku has Gemfile detected, running Bundler version 1.0.7. – Rick Heller Jul 19 '11 at 02:54
  • Have you updated heroku? `gem update heroku`. If you are not using rvm make sure you `sudo gem updated heroku`, and then `gem list` and make sure you only have one version. – thenengah Jul 19 '11 at 11:48
  • I was using an older heroku gem (actually, there were two). Now, I updated the gem and removed the older version, so there's only one heroku gem. But I still get the same error.$ gem list heroku *** LOCAL GEMS *** heroku (2.3.6) – Rick Heller Jul 19 '11 at 13:23
  • Ok, so let nuke the app and start over? – thenengah Jul 19 '11 at 13:28
  • Thank you, Codeglot! I downloaded the data, created a new app, and pushed the data, and moved my custom domain off the old app and onto the new one. My users will be none the wiser, I think. I'm not sure how this would have worked if I was also migrating data, but fortunately, the schema didn't changed. So I'm now up and running with my latest code and heroku seems to be happy. Thanks again. – Rick Heller Jul 19 '11 at 18:36
  • NP! Let me know if you have other questions. Good job to sticking with it! – thenengah Jul 19 '11 at 18:51
0

I've just had the same problem, and the following fixed it for me:

I had a combination of gems grouped by requirement (test, development etc), and some that were used by both e.g.

group :development do
  gem "hpricot"
  gem "ruby_parser"
  gem "haml-rails", ">= 0.3.4"
end

and

gem "rspec-rails", ">= 2.9.0.rc2", :group => [:development, :test]

I deleted the single line ones, and just duplicated them in the relevant blocks (not DRY I know, but what the heck).

Did a quick Bundle, and hey presto I could push to Heroku again...

Les
  • 1,405
  • 15
  • 27
0

From what I have read, this is a windows issue.

Why won't Heroku accept my Gemfile.lock in Windows?

I've spent hours trying to figure this out and no dice. Time to move to a virtual machine and try there. Bummer.

Community
  • 1
  • 1
Tom
  • 459
  • 2
  • 4
  • 17
0

I was getting the same error, and running the following code in the command line solved it:

$ heroku config:set BUNDLE_WITHOUT="development:test"


I think the gemfile.lock issues described above are red herrings.

0

Or, it could be that Heroku is having API issues and is down. Check https://status.heroku.com/

This happened to me today with a mature app.

robwhelan
  • 83
  • 1
  • 5