Hello guys,
I am trying to set up Capistrano 3 for my Rails 4 application, the setup is following:
deploy.rb
---
SSHKit.config.command_map[:rake] = "bundle exec rake"# config valid only for Capistrano 3.1lock '3.1.0'set :application, 'myapp'set :scm, :git set
set :repo_url, 'g...@bitbucket.org:username/repo.git'set :stages, ["staging", "production"]set :default_stage, "staging"set :format, :pretty set
set :pty, trueset :keep_releases, 5namespace :deploy dodesc 'Restart application'task :restart doon roles(:app), in: :sequence, wait: 5 do# Your restart mechanism here, for example:# execute :touch, release_path.join('tmp/restart.txt')endendafter :publishing, :restart after
after :restart, :clear_cache doon roles(:web), in: :groups, limit: 3, wait: 10 do# Here we can do anything such as:# within release_path do# execute :rake, 'cache:clear'# endendend
and in deploy/staging.rb:
role :app, %w{deployer@IP_ADDRESS}
role :web, %w{deployer@IP_ADDRESS}
role :db, %w{deployer@IP_ADDRESS}
server "IP_ADDRESS", user: 'deployer', roles: %w{app web db}
set :deploy_to, "/home/deployer/apps/myapp-staging"
set :ssh_options, {
forward_agent: false,
auth_methods: %w(password),
password: 'my_password',
user: 'deployer',
}
When I run
cap staging deployÂ
I get:
INFO [f15d031b] Running /usr/bin/env mkdir -p /tmp/myapp/ on IP_ADDRESS
DEBUG
DEBUG [f15d031b] Command: /usr/bin/env mkdir -p /tmp/myapp/
cap aborted!
Errno::ECONNREFUSED: Connection refused - connect(2)Â
Why Capistrano can't deploy the app on the staging server?
Thank you in advance for every help. --
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/2fbc6b53-7114-4ef8-8239-07dd779a2cf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/0ff224bb-d697-4eb0-9aa2-614c73e88ac2%40googlegroups.com.
** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
INFO [59f586b5] Running /usr/bin/env mkdir -p /tmp/project_name/ on IP_ADDRESS
DEBUG [59f586b5] Command: /usr/bin/env mkdir -p /tmp/project_name/
cap aborted!
Errno::ECONNREFUSED: Connection refused - connect(2)
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:70:in `initialize'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:70:in `open'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:70:in `block in initialize'
/Users/radek/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/Users/radek/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:67:in `initialize'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/net-ssh-2.8.0/lib/net/ssh.rb:200:in `new'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/net-ssh-2.8.0/lib/net/ssh.rb:200:in `start'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/connection_pool.rb:24:in `create_or_reuse_connection'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:173:in `ssh'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:126:in `block in _execute'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:123:in `tap'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:123:in `_execute'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/capistrano-3.1.0/lib/capistrano/tasks/git.rake:17:in `block (3 levels) in <top (required)>'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/radek/.rvm/gems/ruby-1.9.3-p385/gems/sshkit-1.4.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => git:check => git:wrapper
The deploy has failed with an error: #<Errno::ECONNREFUSED: Connection refused - connect(2)>
** Invoke deploy:failed (first_time)
** Execute deploy:failed
Thanks
and in deploy/staging.rb:
...<code style="font-size:13.63636302947998px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono'
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/c90b92b3-d508-443f-8476-f0069ea15a19%40googlegroups.com.
...