Ved*_*Ved 22 git ruby-on-rails 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)
-----> 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'
Run Code Online (Sandbox Code Playgroud)
我尝试将Gemfile和Gemfile.lock添加到git但无济于事.我尝试删除.bundle目录和Gemfile.lock,但同样的错误.
Adi*_*ghi 15
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
Run Code Online (Sandbox Code Playgroud)
所以现在我只需要创建一个捆绑的脚本然后从锁定文件中删除它.
无论是Gemfile和Gemfile.lock文件需要被包含在git仓库.确保您没有在.gitignore文件中忽略它们.
此外,请确保在本地计算机上使用Bundler> = 1.0.0来生成Gemfile.lock.我使用的是过时的版本,比如Bundler 0.9x,它会失败.
最后但并非最不重要的,更新您的Gemfile.lock(如果有).
$ cd /path/to/project
$ bundle update
Run Code Online (Sandbox Code Playgroud)