Heroku rejecting push in mature application (pre-receive hook declined)
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 …………..
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.
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...
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.
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.
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.
精彩评论