Ruby on rails 未签入Gemfile.lock-Heroku
在尝试“git push heroku master”时,我不断得到错误:Ruby on rails 未签入Gemfile.lock-Heroku,ruby-on-rails,git,heroku,bundler,Ruby On Rails,Git,Heroku,Bundler,在尝试“git push heroku master”时,我不断得到错误: Counting objects: 266, done. Delta compression using up to 4 threads. Compressing objects: 100% (239/239), done. Writing objects: 100% (266/266), 222.68 KiB, done. Total 266 (delta 55), reused 0 (delta 0) -----&
Counting objects: 266, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (239/239), done.
Writing objects: 100% (266/266), 222.68 KiB, done.
Total 266 (delta 55), reused 0 (delta 0)
-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.3
Unresolved dependencies detected; Installing...
Using --without development:test
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have deleted from the Gemfile:
* version: 1.0.6
FAILED: http://docs.heroku.com/bundler
! Heroku push rejected, failed to install gems via Bundler
error: hooks/pre-receive exited with error code 1
To git@heroku.com:freezing-frost-65.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:freezing-frost-65.git'
我尝试将Gemfile和Gemfile.lock添加到git中,但没有效果。我尝试删除.bundle目录和Gemfile.lock,但出现了相同的错误。git存储库中需要包括
Gemfile
和Gemfile.lock
文件。
确保在.gitignore
文件中没有忽略它们
另外,请确保在本地计算机上使用Bundler>=1.0.0生成Gemfile.lock
。如果您使用过时的版本,如Bundler 0.9x,它将失败
最后,更新Gemfile.lock(如果有)
$ cd /path/to/project
$ bundle update
在-找到答案bundler 1.0.6版存在问题
您需要在开发机器上运行“gem update bundler”以将bundler更新为1.0.7。然后,您需要在应用程序中运行bundle update以生成新的Gemfile.lock文件。您将看到Gemfile.lock已更新。提交这个新的Gemfile.lock并再次推送到heroku。我通过打开Gemfile.lock并删除以下两行修复了我的问题:
PLATFORMS
x86-mingw32
所以现在我只需要制作一个脚本,然后将它从锁文件中删除。我删除了Gemfile.lock文件平台下的“mingw”行,添加并提交到git,将它推到git,然后将所有内容推到heroku,显然它现在可以工作了。在你的applicaton目录中,在
bin
子目录中修改文件
bin/bundle
bin/rails
bin/rake
而不是
'#!/usr/bin/env ruby.exe
一定是
'#!/usr/bin/env ruby
(感谢以前的帖子)
确保gemfile.lock中没有对窗口的引用-可以删除它们
然后
如果仍然存在问题,请使用heroku日志(将文本复制到文本编辑器可以更轻松地剪切和粘贴以获得解决方案).我进行了捆绑更新,我的.gitignore中没有Gemfile或Gemfile.lock.bundle-v Bundler 1.0版。6@Ved:重要的是这些文件是否存在于您试图推送到heroku的提交中。你是从当地的回购协议,而不是从github。(当然,可能这些文件是同步的;我不知道。)如何查找这些文件是否在主分支中?我也试着删除并阅读它们。好吧,这对我和其他很多人(考虑到谷歌点击和未点击的数量)来说似乎是一个完全的拦路虎。阿迪蒂亚,这是正确的。我刚刚删除了版本标签,一切都很顺利。但我也会尝试这种方法。谢谢。然后你需要在你的应用程序中运行bundle update来生成一个新的Gemfile.lock文件。这对我很有用!Heroku似乎会忽略您的Gemfile。这些行的锁都存在。相关:
git push heroku master