9

Railscast on Deploying to a VPS に従っていましたが、試して実行するまではすべてスムーズに進みましたcap deploy。ディレクトリを検索しようとすると失敗するようです。エラーメッセージは次のとおりです。

* executing `deploy'
triggering before callbacks for `deploy'
 * executing `deploy:check_revision'
 * executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:markprovan/dropwall_rails.git master"
command finished in 2531ms
* executing "if [ -d /home/deployer/apps/dropwall_rails/shared/cached-copy ]; then cd   /home/deployer/apps/dropwall_rails/shared/cached-copy && git fetch -q origin && git fetch -- tags -q origin && git reset -q --hard 9407f1feb2ea5b1c4a0666196bdcbb9ad888563e && git clean -q -d -x -f; else git clone -q git@github.com:markprovan/dropwall_rails.git /home/deployer/apps/dropwall_rails/shared/cached-copy && cd /home/deployer/apps/dropwall_rails/shared/cached-copy && git checkout -q -b deploy 9407f1feb2ea5b1c4a0666196bdcbb9ad888563e; fi"
servers: ["209.61.142.61"]
Password: 
[209.61.142.61] executing command
** [209.61.142.61 :: out] The authenticity of host 'github.com (207.97.227.239)' can't be established.
** RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
** Are you sure you want to continue connecting (yes/no)?
** [209.61.142.61 :: out] yes
** Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
command finished in 2655ms
copying the cached version to /home/deployer/apps/dropwall_rails/releases/20120513204913
* executing "cp -RPp /home/deployer/apps/dropwall_rails/shared/cached-copy /home/deployer/apps/dropwall_rails/releases/20120513204913 && (echo 9407f1feb2ea5b1c4a0666196bdcbb9ad888563e > /home/deployer/apps/dropwall_rails/releases/20120513204913/REVISION)"
servers: ["209.61.142.61"]
[209.61.142.61] executing command
** [out :: 209.61.142.61] cp: cannot create directory `/home/deployer/apps/dropwall_rails/releases/20120513204913': No such file or directory
command finished in 482ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/deployer/apps/dropwall_rails/releases/20120513204913; true"
servers: ["209.61.142.61"]
[209.61.142.61] executing command
command finished in 479ms
failed: "sh -c 'cp -RPp /home/deployer/apps/dropwall_rails/shared/cached-copy /home/deployer/apps/dropwall_rails/releases/20120513204913 && (echo 9407f1feb2ea5b1c4a0666196bdcbb9ad888563e > /home/deployer/apps/dropwall_rails/releases/20120513204913/REVISION)'" on 209.61.142.61

私はこれに何年も費やしてきましたが、どこが間違っているのかを見つけることができないようです。

4

2 に答える 2

23

実行cap deploy:setupしましたcap deploy:checkか?これらは、多くの一般的な問題を浮き彫りにするはずです。

ただし、上記の失敗の原因となっているエラーは、アクセス許可の問題のようです。

cp: cannot create directory `/home/deployer/apps/dropwall_rails/releases/20120513204913': No such file or directory

フォルダーが存在し、展開ユーザーがそれを操作するための正しいアクセス許可を持っていることを確認してください。

于 2012-05-13T21:44:56.907 に答える
0

権限の問題は、Capistrano のデフォルトの use_sudo の動作が原因である可能性があります。

これは、次の構成パラメーターでオーバーライドできます: set :use_sudo, false

奇妙なことに、このパラメーターが false に設定されていない場合、Capistrano は一部のコマンドで sudo を使用し、他のコマンドでは使用しません。私にはバグのようです。

于 2014-05-07T11:18:53.013 に答える