当推送到我的临时应用程序时,Heroku抱怨bundle install
失败,我需要在其他地方运行bundle install
并对生成的Gemfile.lock
进行版本控制。问题是我已经已经完成了这项工作并提交了它。
我该如何解决这个问题?
由于在工作中继承了一些可怕的东西,我不得不在生产中调试和修复一些东西。现在一切都在工作,但这意味着我们的master
分支超过了staging
10次提交,包括一些宝石更改。我合并了他们并尝试在Heroku上推送我的临时应用程序。
然而,在合并更改后我没有运行bundle install
(对我感到羞耻),所以Heroku正确地抱怨。
为了解决这个问题,我运行了标准:
bundle install
git add Gemfile.lock
git commit -m "Updated gem bundle"
git push staging
然而,Heroku仍抱怨Gemfile.lock
:
Counting objects: 228, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (179/179), done.
Writing objects: 100% (192/192), 24.38 KiB | 0 bytes/s, done.
Total 192 (delta 127), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/ruby
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.2
remote: -----> Installing dependencies using bundler 1.11.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote: You have deleted from the Gemfile:
remote: * ruby-drupal-hash
remote: Bundler Output: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote:
remote: You have deleted from the Gemfile:
remote: * ruby-drupal-hash
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to redacted-staging.
remote:
To https://git.heroku.com/redacted-staging.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/redacted-staging.git'
此外:
Gemfile.lock
在<{1}} .gitignore
运行正常,并且不会更新任何宝石(因为我现在已多次运行它)。bundle install
和git status
以确保我实际添加并提交了更改;我显然不是疯了(但如果我错了,请纠正我。)我 已经 运行
git log
并添加&amp;已提交bundle install
我该如何解决这个问题?
我错过了什么?
我已经尝试了
Gemfile.lock
更新了26颗宝石;提交新的bundle update
并推送结果会出现同样的错误。Gemfile.lock
。添加换行符并推送结果会出现同样的错误。Gemfile.lock
删除Bundler的版本信息并推送相同的错误。Gemfile.lock
gem,运行了ruby-drupal-hash
,并推送了新的bundle install
和Gemfile
文件。有趣的是,关于我删除Gemfile.lock
的错误消息仍然存在,尽管它再次出现。答案 0 :(得分:1)
我假设你在不同的操作系统本地工作,然后你的服务器就是,例如windows vs Unix。
为了解决这个问题,您只需使用以下标志构建它:
bundle install --deployment
如果这不起作用,只需删除.lock文件,然后在安装/更新之前的流程中再次生成。
答案 1 :(得分:0)
是的,尝试运行bundle update
或者如果它不起作用,我认为这条线看起来很有趣:
remote: You have deleted from the Gemfile:
remote: * ruby-drupal-hash
remote: Bundler Output: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote:
remote: You have deleted from the Gemfile:
remote: * ruby-drupal-hash
答案 2 :(得分:0)
似乎抱怨ruby-drupal-hash从Gemfile中删除但是Gemfile.lock没有反映它。
You have deleted from the Gemfile:
remote: * ruby-drupal-hash
我会检查那个特定gem的Gemfile和Gemfile.lock,看看是不是问题。
答案 3 :(得分:0)
答案看似简单(当然):
git push staging staging:master
问题是我在staging
分支机构,需要更新我的Heroku登台服务器的master
分支。
因为忽略了如此明显的事情而感到羞耻! ......并且对Heroku的显然无益的输出感到羞耻。