Я пытаюсь запустить свое первое приложение Rails 3 на VDS. Поэтому я решил использовать для этого капистрано. Также у меня есть пассажир Phusion, Nginx, RVM и ruby 1.9.3.
Я использую эту ссылку как учебник - https://github.com/capistrano/capistrano/wiki/2.x-From-The-Beginning
Итак, когда я печатаю
cap deploy:check
Тогда все в порядке:
* executing `deploy:check'
* executing "test -d /vol/www/apps/ror_tutorial/releases"
servers: ["188.127.224.136"]
Password: <my password>
[188.127.224.136] executing command
command finished in 87ms
* executing "test -w /vol/www/apps/ror_tutorial"
servers: ["188.127.224.136"]
[188.127.224.136] executing command
command finished in 63ms
* executing "test -w /vol/www/apps/ror_tutorial/releases"
servers: ["188.127.224.136"]
[188.127.224.136] executing command
command finished in 72ms
* executing "which git"
servers: ["188.127.224.136"]
[188.127.224.136] executing command
command finished in 65ms
You appear to have all necessary dependencies installed
Но когда я пытаюсь сделать следующий шаг:
cap deploy:update
Я получаю странную ошибку:
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:Loremaster/sample_app.git master"
command finished in 4097ms
* executing "git clone -q git@github.com:Loremaster/sample_app.git /vol/www/apps/ror_tutorial/releases/20120118170908 && cd /vol/www/apps/ror_tutorial/releases/20120118170908 && git checkout -q -b deploy f0cf5d0141c80ab82d9191e72aabeddb8cf6e552 && (echo f0cf5d0141c80ab82d9191e72aabeddb8cf6e552 > /vol/www/apps/ror_tutorial/releases/20120118170908/REVISION)"
servers: ["188.127.224.136"]
Password: <my password>
[188.127.224.136] executing command
** [188.127.224.136 :: out] Permission denied (publickey).
** fatal: The remote end hung up unexpectedly
command finished in 1573ms
*** [deploy:update_code] rolling back
* executing "rm -rf /vol/www/apps/ror_tutorial/releases/20120118170908; true"
servers: ["188.127.224.136"]
[188.127.224.136] executing command
command finished in 63ms
failed: "sh -c 'git clone -q git@github.com:Loremaster/sample_app.git /vol/www/apps/ror_tutorial/releases/20120118170908 && cd /vol/www/apps/ror_tutorial/releases/20120118170908 && git checkout -q -b deploy f0cf5d0141c80ab82d9191e72aabeddb8cf6e552 && (echo f0cf5d0141c80ab82d9191e72aabeddb8cf6e552 > /vol/www/apps/ror_tutorial/releases/20120118170908/REVISION)'" on 188.127.224.136
Как я могу это исправить?
Вот мой config / deploy.rb :
set :user, "root"
default_run_options[:pty] = true
set :repository, "git@github.com:Loremaster/sample_app.git"
set :application, "ror_tutorial"
set :deploy_to, "/vol/www/apps/#{application}"
set :scm, :git
set :branch, "master"
server "188.127.224.136", :app,
:web,
:db, :primary => true
namespace :passenger do
desc "Restart Application"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
after :deploy, "passenger:restart"