2012-05-13 46 views
9

Tôi đã theo dõi Railscast về Triển khai cho VPS và mọi thứ diễn ra suôn sẻ cho đến khi tôi thử chạy cap deploy. Dường như nó không thành công khi tìm một thư mục. Đây là thông báo lỗi:Lỗi khi triển khai sử dụng Capistrano

* 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 [email protected]: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 [email protected]: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 

Tôi đã dành nhiều tuổi về điều này và dường như không thể tìm thấy nơi tôi đang đi sai.

Trả lời

23

Bạn có chạy cap deploy:setupcap deploy:check không? Điều này sẽ làm nổi bật rất nhiều vấn đề phổ biến.

Lỗi gây ra lỗi ở trên tuy nhiên trông giống như vấn đề quyền.

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

Đảm bảo rằng thư mục tồn tại và người dùng triển khai có quyền phù hợp để thao tác.

0

Sự cố đặc quyền có thể do hành vi sử dụng Capistrano use_sudo mặc định.

này có thể được ghi đè bởi các tham số cấu hình sau: thiết lập: use_sudo, false

Điều kỳ lạ là nếu tham số này không được thiết lập là false, Capistrano sẽ sử dụng sudo cho một số lệnh và sẽ không sử dụng nó cho người khác. Có vẻ như một lỗi đối với tôi.

Các vấn đề liên quan