行,所以我有一個新的EC2實例,它是所有設置和我ssh與用戶EC2用戶和我的本地機器上,我跑了檢查命令爲什麼我的capistrano失敗了?
cap deploy:check
* executing `deploy:check'
* executing "test -d /var/www/projects/releases"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 101ms
* executing "test -w /var/www/projects"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 106ms
* executing "test -w /var/www/projects/releases"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 103ms
* executing "which git"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 104ms
You appear to have all necessary dependencies installed
所有似乎確定那裏,但是當我這樣做帽部署在結尾
[50.19.84.170] executing command
command finished in 150ms
failed: "sh -c 'rm -f /var/www/projects/current && ln -s /var/www/projects/releases/2012/var/www/projects/current'" on 50.19.84.170
然後我看看是否有什麼在版本目錄中並沒有什麼
ls -la /var/www/projects/releases/total 8
drwxrwxr-x 2 ec2-user ec2-user 4096 Jan 23 13:37 .
drwxrwxr-x 5 ec2-user ec2-user 4096 Jan 20 03:03 ..
不知道我在做什麼WR得到這個錯誤翁...這裏是我的deploy.rb
set :application, "projects"
set :deploy_to, "/var/www/#{application}"
set :keep_releases, 3
set :scm, :git
set :repository, "[email protected]:railsdevmatt/fat_free_crm.git"
set :git_shallow_clone, 1
set :branch, "master"
set :use_sudo, true
set :user, "ec2-user"
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
role :app, "50.19.84.170"
role :web, "50.19.84.170"
role :db, "50.19.84.170", :primary => true
after "deploy:setup", :fix_perms
after "deploy:update_code", :fix_perms
# ssh_options[:keys] = ["#{ENV['HOME']}/Downloads/important.pem"]
task :fix_perms do
# sudo "chown apache:webshare -R /var/www/projects"
# sudo "chmod 666 -R /var/www/projects/shared/log/*"
end
什麼,我需要改變
UPDATE
這裏是我的整個輸出
cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote [email protected]:railsdevmatt/fat_free_crm.git master"
/Library/Ruby/Gems/1.8/gems/capistrano-2.6.0/lib/capistrano/recipes/deploy.rb:104: warning: Insecure world writable dir /Users/mattelhotiby in PATH, mode 040777
command finished in 1061ms
* executing "git clone -q --depth 1 [email protected]b.com:railsdevmatt/fat_free_crm.git /var/www/projects/releases/2012&& cd /var/www/projects/releases/2012&& git checkout -q -b deploy 65b439e201c2134fc97ee10a4ea66174018d8553 && (echo 65b439e201c2134fc97ee10a4ea66174018d8553 > /var/www/projects/releases/2012/REVISION)"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 1898ms
* executing `deploy:finalize_update'
* executing "chmod -R g+w /var/www/projects/releases/2012"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 123ms
* executing "rm -rf /var/www/projects/releases/2012/log /var/www/projects/releases/2012/public/system /var/www/projects/releases/2012/tmp/pids &&\\\n mkdir -p /var/www/projects/releases/2012/public &&\\\n mkdir -p /var/www/projects/releases/2012/tmp &&\\\n ln -s /var/www/projects/shared/log /var/www/projects/releases/2012/log &&\\\n ln -s /var/www/projects/shared/system /var/www/projects/releases/2012/public/system &&\\\n ln -s /var/www/projects/shared/pids /var/www/projects/releases/2012/tmp/pids"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 133ms
* executing "find /var/www/projects/releases/2012/public/images /var/www/projects/releases/2012/public/stylesheets /var/www/projects/releases/2012/public/javascripts -exec touch -t 2012.55 {} ';'; true"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
** [out :: 50.19.84.170] find: `/var/www/projects/releases/2012/public/images': No such file or directory
** [out :: 50.19.84.170] find: `/var/www/projects/releases/2012/public/stylesheets': No such file or directory
** [out :: 50.19.84.170] find: `/var/www/projects/releases/2012/public/javascripts': No such file or directory
command finished in 111ms
triggering after callbacks for `deploy:update_code'
* executing `fix_perms'
* executing "sudo -p 'sudo password: ' chown apache:webshare -R /var/www/projects"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 136ms
* executing "sudo -p 'sudo password: ' chmod 666 -R /var/www/projects/shared/log/*"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
** [out :: 50.19.84.170] chmod: cannot access `/var/www/projects/shared/log/*': No such file or directory
command finished in 119ms
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/projects/releases/2012; true"
servers: ["50.19.84.170"]
[50.19.84.170] executing command
command finished in 145ms
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' chmod 666 -R /var/www/projects/shared/log/*'" on 50.19.84.170
這裏是目錄
任何想法ls -la /var/www/projects/shared/
total 20
drwxrwxr-x 5 apache webshare 4096 Jan 23 13:32 .
drwxrwxr-x 5 apache webshare 4096 Jan 20 03:03 ..
drwxrwxr-x 2 apache webshare 4096 Jan 20 03:31 log
drwxrwxr-x 2 apache webshare 4096 Jan 23 13:32 pids
drwxrwxr-x 2 apache webshare 4096 Jan 23 13:32 system
向我們展示整個capistrano輸出。儘管失敗報告結束了,但其原因通常較早。 –
現在增加它... – Trace
@MichałKwiatkowski - 完成 – Trace