1

输出:

Counting objects: 96, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (73/73), done.
Writing objects: 100% (73/73), 7.87 KiB | 0 bytes/s, done.
Total 73 (delta 56), reused 0 (delta 0)

-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.2
       Fixing nokogiri install. Clearing bundler cache.
       See https://github.com/sparklemotion/nokogiri/issues/923.
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       You are trying to install in deployment mode after changing
       your Gemfile. Run `bundle install` elsewhere and add the
       updated Gemfile.lock to version control.
       You have added to the Gemfile:
       * postmark-rails (~> 0.5.2)
       You have deleted from the Gemfile:
       * postmark-rails
       Bundler Output: You are trying to install in deployment mode after changing
       your Gemfile. Run `bundle install` elsewhere and add the
       updated Gemfile.lock to version control.


       You have added to the Gemfile:
       * postmark-rails (~> 0.5.2)

       You have deleted from the Gemfile:
       * postmark-rails
 !
 !     Failed to install gems via Bundler.
 !

 !     Push rejected, failed to compile Ruby/Rails app

Auto packing the repository for optimum performance.
To git@heroku.com:sutra-staging.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:sutra-staging.git'
Everything up-to-date

Gemfile.lock的是版本控制。

4

2 回答 2

5

您说您Gemfile.lock在版本控制中,但您的错误消息说Gemfile.lock与您的Gemfile.

您需要在bundle install本地提交修改后的Gemfile.lock.

于 2013-08-31T16:09:24.820 回答
3

发生的事情是您更改了 Gemfile,但尚未使用 Bundler 在本地更新 gem。这意味着您的Gemfile文件和您的Gemfile.lock文件不同步。

为了解决这个问题,运行bundle install,提交您的更改,然后再次推送到 Heroku。这将安装postmark-rails您添加的 gem,更新Gemfile.lock并重新同步所有内容。

可能让您感到困惑的是使用安装 gemgem install并不会更新 Bundler 知道的 gem。Bundler 的工作是为你的项目管理 gem,所以任何时候你添加一个新的 gem,确保运行 Bundler 来更新东西。

于 2013-08-31T16:49:28.547 回答