Can't deploy Rails app via Capistrano
-
29-10-2019 - |
Question
I try to run my first Rails 3 app on vds. So, i decided to use capistrano for that. Also i have Phusion passenger, Nginx, RVM and ruby 1.9.3 there.
I use this link as tutorial - https://github.com/capistrano/capistrano/wiki/2.x-From-The-Beginning
So, when i print
cap deploy:check
Then everything ok:
* 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
But when i try to do next step:
cap deploy:update
I receive strange error:
* 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
How can i fix that?
Here is my 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"
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow