ruby-on-rails - Heroku 拒绝成熟应用中的推送(pre-receive hook declined)

标签 ruby-on-rails ruby heroku gem

我得到了

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

! Heroku 推送被拒绝,无法通过 Bundler 安装 gems 到 git@heroku.com:... ! [remote rejected] master -> master(pre-receive hook declined) 错误:未能将一些引用推送到………….. (完整列表见底部)

这是一个目前在 heroku 上运行的应用程序,但 heroku 不允许 git push heroku master 更新代码。

但是,如果我将代码克隆到一个新文件夹并执行 heroku create 以使用种子数据创建一个新应用程序,则新应用程序可以正常工作。但是,我不想使用新应用,因为我有关于我想要保留的正常运行应用的数据。

现有应用程序或 gem 上似乎有某些内容正在拒绝更新。我不认为数据可以阻止安装 gem,所以我不知道该怎么做。

建议?

“Heroku push rejected, failed to install gems via Bundler”是指问题出在更新 gem 上,还是转移注意力?

谢谢。

$ git push heroku 大师 计数对象:536,完成。 使用最多 2 个线程的增量压缩。 压缩对象:100% (125/125),完成。 写入对象:100% (391/391),1.08 MiB,完成。 总计 391(delta 262),重复使用 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 推送被拒绝,无法通过 Bundler 安装 gems

致 git@heroku.com:... ! [remote rejected] master -> master(pre-receive hook declined) 错误:无法将某些引用推送到…………..

最佳答案

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

这意味着您已经将 gem 添加到您的 gemfile 但还没有更新到。 Gemfile.lock 与此文件不同步。

您需要更新您的包。

在您的应用程序目录中的控制台中运行此命令:bundle

然后执行 git push heroku

你应该可以开始了。

**核对应用程序并重新开始。

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

这应该会启动一个新的应用程序。

关于ruby-on-rails - Heroku 拒绝成熟应用中的推送(pre-receive hook declined),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6740777/

相关文章:

reactjs - React Router with Express,子页面在生产中无法正确路由

html - 设置表头和填充数据; Rails 和 SLIM

ruby-on-rails - 使用 Twitter/Facebook/Google 注册 Rails 用户?

javascript - before_update 无法与 Ajax、Rails 4 一起正常工作

ruby-on-rails - 如何在 Ruby 中将图像写入到文件系统的 url 中?

ruby-on-rails - 每次我运行 rails server 时种子数据库

python - 如何从 Heroku/Cedar 的 virtualenv 中清除陈旧的 pypi 包?

ruby-on-rails - jquery-file-upload POST 和嵌套路由 - 没有路由匹配 PATCH

ruby - 为什么问号在 Ruby 中被解释为 "z"

css - 当窗口的宽度变小时链接消失 bootstrap