2013-02-15 72 views
3

部署到生產服務器時,我收到此錯誤:如何調試時部署到capistrano?

$ cap production deploy 
    triggering load callbacks 
    * ←[32m2013-02-16 00:06:00 executing `production'←[0m 
    triggering start callbacks for `deploy' 
    * ←[32m2013-02-16 00:06:00 executing `multistage:ensure'←[0m 
    * ←[32m2013-02-16 00:06:00 executing `deploy'←[0m 
    * ←[32m2013-02-16 00:06:00 executing `deploy:update'←[0m 
** transaction: start 
    * ←[32m2013-02-16 00:06:00 executing `deploy:update_code'←[0m 
    updating the cached checkout on all servers 
    ←[33mexecuting locally: "git ls-remote [email protected]:user/app.git 
production"←[0m 
    ←[2;37mcommand finished in 3350ms←[0m 
    * ←[33mexecuting "if [ -d /var/www/app/shared/cached-copy ]; then cd /var/ 
www/app/shared/cached-copy && git fetch -q origin && git fetch --tags -q ori 
gin && git reset -q --hard f736340ecbsadasd948234f370c9d2bb && git clean 
-q -d -x -f; else git clone -q [email protected]:user/app.git /var/www/app/shared/cached-copy && cd /var/www/app/shared/cached-copy && git checko 
ut -q -b deploy f736340ecasdsadasf795761f370c9d2bb; fi"←[0m 
    servers: ["x"] 
Password: 
    [x] executing command 
** ←[31m[x :: out] error: cannot open .git/FETCH_HEAD: Permission d 
enied←[0m 
    ←[2;37mcommand finished in 570ms←[0m 
*** [←[34mdeploy:update_code←[0m] ←[34mrolling back←[0m 
    * ←[33mexecuting "rm -rf /var/www/app/releases/20130215230611; true"←[0m 
    servers: ["x"] 
    [x] executing command 
    ←[2;37mcommand finished in 176ms←[0m 
failed: "sh -c 'if [ -d /var/www/app/shared/cached-copy ]; then cd /var/www/ 
app/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin 
&& git reset -q --hard f736340342af1bsad79453761f370c9d2bb && git clean -q 
-d -x -f; else git clone -q [email protected]:user/app.git /var/www/app 
o/shared/cached-copy && cd /var/www/app/shared/cached-copy && git checkout - 
q -b deploy f736340ecb6af1bgaasd5549d2bb; fi'" on x 
$ 

但錯誤是不是隻是告訴我,有創業板文件/包安裝問題很重要。

怎麼可能得到一個更詳細的錯誤日誌,我可以看到問題的確切位置。

+0

您需要顯示所有的輸出,很可能所有你需要的信息已經有 – mpapis 2013-02-16 09:21:32

+0

@mpapis - 我與日誌更新的問題.. – 2013-02-16 10:38:33

回答

2

看起來你已經跑了sudo的命令之一,這導致錯誤的權限/var/www/app/shared/cached-copy/.git/FETCH_HEAD,最簡單的解決將是最有可能清洗整個目錄:

sudo rm -rf /var/www/app/shared/cached-copy 

如果問題對其他重複目錄然後嘗試:

sudo chown -R $USER: /var/www/app 
+0

我發現通過運行cap production部署,這是一些許可問題:檢查。現在我只是因爲RVM未加載而出現錯誤。 – 2013-02-16 14:12:19

+0

這是其他問題用您的日誌打開一個新的問題 – mpapis 2013-02-16 18:21:27