2010-11-23 34 views
22

雖然試圖以「混帳推Heroku的大師」,我不斷收到錯誤:Gemfile.lock的在沒有檢查 - Heroku的

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 [email protected]:freezing-frost-65.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:freezing-frost-65.git' 

我嘗試添加的Gemfile和Gemfile.lock的與git,但無濟於事。我嘗試刪除.bundle目錄和Gemfile.lock但同樣的錯誤。

+0

相關:http://stackoverflow.com/questions/14034561/should-gemfile-lock-be-committed-to-source-control-on-windows – ripper234 2012-12-25 22:55:31

回答

6

無論是GemfileGemfile.lock文件需要被包含在git倉庫。 請確保你沒有忽略它們在.gitignore文件中。

此外,請確保您使用的捆紮機> = 1.0.0在本地計算機上生成Gemfile.lock。我使用的是過時的版本,比如Bundler 0.9x,它會失敗。

最後但並非最不重要的,更新Gemfile.lock的,如果你有一個。

$ cd /path/to/project 
$ bundle update 
+0

我沒有捆綁更新和我的.gitignore沒有Gemfile或Gemfile.lock在裏面。 – Ved 2010-11-23 17:08:06

+0

bundle -v Bundler版本1.0.6 – Ved 2010-11-23 17:10:42

+1

也是https:// github。com/antani/socal在回購中顯示了這兩個文件。 – Ved 2010-11-23 17:15:29

15

沒有與捆綁版本1.0.6 一個問題,您需要在開發機器上運行的「寶石更新捆綁」更新打捆到1.0.7。然後,您需要在應用中運行軟件包更新以生成新的Gemfile.lock文件。您會看到Gemfile.lock已更新。提交這個新的Gemfile.lock並再次推送到heroku。

8

我固定礦山打開Gemfile.lock的並刪除下面兩行:

PLATFORMS 
    x86-mingw32 

所以,現在我只需要作出這樣的捆綁,然後刪除該腳本從鎖文件。

3

我刪除下平臺「MinGW的」行我Gemfile.lock的文件,並將致力於與git,又將其與git,然後推一切Heroku的,顯然現在的工作。

0

在你的一個應用目錄下,在bin子目錄中修改文件

bin/bundle 
bin/rails 
bin/rake 

而不是

'#!/usr/bin/env ruby.exe 

必須

'#!/usr/bin/env ruby 

(感謝以前的帖子)

確保沒有對gemfile.lock中的窗口的引用 - 它們可以被刪除。

然後

git push heroku master 

如果還有問題,使用heroku logs(文本複製到一個文本編輯器,可以更容易地剪切和粘貼的解決方案)。

相關問題