2010-03-05 62 views
1

我與capistrano的rails應用程序的部署失敗了,我希望有人能夠爲我提供排除故障的指針。 以下是命令輸出我正在嘗試使用Capistrano部署我的第一個rails應用程序,並且出現錯誤

[email protected]:~/projects/rails/guestbook2$ cap deploy:setup 
    * executing `deploy:setup' 
    * executing "mkdir -p /var/www/dev/guestbook2 /var/www/dev/guestbook2/releases /var/www/dev/guestbook2/shared /var/www/dev/guestbook2/shared/system /var/www/dev/guestbook2/shared/log /var/www/dev/guestbook2/shared/pids && chmod g+w /var/www/dev/guestbook2 /var/www/dev/guestbook2/releases /var/www/dev/guestbook2/shared /var/www/dev/guestbook2/shared/system /var/www/dev/guestbook2/shared/log /var/www/dev/guestbook2/shared/pids" 
    servers: ["dev.andrewbucknell.com"] 
Enter passphrase for /home/andrew/.ssh/id_dsa: 
Enter passphrase for /home/andrew/.ssh/id_dsa: 
    [dev.andrewbucknell.com] executing command 
    command finished 
[email protected]:~/projects/rails/guestbook2$ cap deploy:check 
    * executing `deploy:check' 
    * executing "test -d /var/www/dev/guestbook2/releases" 
    servers: ["dev.andrewbucknell.com"] 
Enter passphrase for /home/andrew/.ssh/id_dsa: 
    [dev.andrewbucknell.com] executing command 
    command finished 
    * executing "test -w /var/www/dev/guestbook2" 
    servers: ["dev.andrewbucknell.com"] 
    [dev.andrewbucknell.com] executing command 
    command finished 
    * executing "test -w /var/www/dev/guestbook2/releases" 
    servers: ["dev.andrewbucknell.com"] 
    [dev.andrewbucknell.com] executing command 
    command finished 
    * executing "which git" 
    servers: ["dev.andrewbucknell.com"] 
    [dev.andrewbucknell.com] executing command 
    command finished 
    * executing "test -w /var/www/dev/guestbook2/shared" 
    servers: ["dev.andrewbucknell.com"] 
    [dev.andrewbucknell.com] executing command 
    command finished 
You appear to have all necessary dependencies installed 
[email protected]:~/projects/rails/guestbook2$ cap deploy:migrations 
    * executing `deploy:migrations' 
    * executing `deploy:update_code' 
    updating the cached checkout on all servers 
    executing locally: "git ls-remote [email protected]:/home/andrew/git/guestbook2.git master" 
Enter passphrase for key '/home/andrew/.ssh/id_dsa': 
    * executing "if [ -d /var/www/dev/guestbook2/shared/cached-copy ]; then cd /var/www/dev/guestbook2/shared/cached-copy && git fetch origin && git reset --hard 369c5e04aaf83ad77efbfba0141001ac90915029 && git clean -d -x -f; else git clone [email protected]:/home/andrew/git/guestbook2.git /var/www/dev/guestbook2/shared/cached-copy && cd /var/www/dev/guestbook2/shared/cached-copy && git checkout -b deploy 369c5e04aaf83ad77efbfba0141001ac90915029; fi" 
    servers: ["dev.andrewbucknell.com"] 
Enter passphrase for /home/andrew/.ssh/id_dsa: 
    [dev.andrewbucknell.com] executing command 
** [dev.andrewbucknell.com :: err] Permission denied, please try again. 
** Permission denied, please try again. 
** Permission denied (publickey,password). 
** [dev.andrewbucknell.com :: err] fatal: The remote end hung up unexpectedly 
** [dev.andrewbucknell.com :: out] Initialized empty Git repository in /var/www/dev/guestbook2/shared/cached-copy/.git/ 
    command finished 
failed: "sh -c 'if [ -d /var/www/dev/guestbook2/shared/cached-copy ]; then cd /var/www/dev/guestbook2/shared/cached-copy && git fetch origin && git reset --hard 369c5e04aaf83ad77efbfba0141001ac90915029 && git clean -d -x -f; else git clone [email protected]:/home/andrew/git/guestbook2.git /var/www/dev/guestbook2/shared/cached-copy && cd /var/www/dev/guestbook2/shared/cached-copy && git checkout -b deploy 369c5e04aaf83ad77efbfba0141001ac90915029; fi'" on dev.andrewbucknell.com 
[email protected]:~/projects/rails/guestbook2$ 

以下片段來自cap -d deploy:migrations

Preparing to execute command: "find /var/www/dev/guestbook2/releases/20100305124415/public/images /var/www/dev/guestbook2/releases/20100305124415/public/stylesheets /var/www/dev/guestbook2/releases/20100305124415/public/javascripts -exec touch -t 201003051244.22 {} ';'; true" 
Execute ([Yes], No, Abort) ? |y| yes 
    * executing `deploy:migrate' 
    * executing "ls -x /var/www/dev/guestbook2/releases" 
Preparing to execute command: "ls -x /var/www/dev/guestbook2/releases" 
Execute ([Yes], No, Abort) ? |y| yes 
/usr/lib/ruby/gems/1.8/gems/capistrano-2.5.17/lib/capistrano/recipes/deploy.rb:55:in `join': can't convert nil into String (TypeError) 
    from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.17/lib/capistrano/recipes/deploy.rb:55:in `load' 

回答

0

我看來像在服務器端權限問題。

Enter passphrase for /home/andrew/.ssh/id_dsa: 
[dev.andrewbucknell.com] executing command 
** [dev.andrewbucknell.com :: err] Permission denied, please try again. 
** Permission denied, please try again. 
** Permission denied (publickey,password). 
** [dev.andrewbucknell.com :: err] fatal: The remote end hung up unexpectedly 
+1

有關識別哪些實體沒有正確權限的任何提示? – 2010-03-05 14:49:23

0

看起來像git(在服務器上)有困難與git服務器進行身份驗證。

0

對我來說非常有幫助的是在做任何事情之前運行cap deploy:check。一旦運行無錯誤,將所有其他內容排序就容易得多。

4

我爲我的deploy.rb添加了default_run_options [:pty] = true,並且一切正常。我在debian上運行 - 我想它需要它自己的pty或其他東西來獲得正確的權限。感謝您的提示傢伙。

+0

這可能是爲他人http://help.github.com/deploy-with-capistrano/有用 – ed209 2011-12-08 21:09:15

相關問題