# Capistrano (Errno::ECONNREFUSED: Connection refused - connec

**URL:** <https://www.ruby-forum.com/t/capistrano-errno-connection-refused-connec/117978>\
**Category:** Deployment\
**Created:** [October 22, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/capistrano-errno-connection-refused-connec/117978 "2007-10-22T22:54:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xbelanch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/4da419/32.png) [@xbelanch](https://www.ruby-forum.com/u/xbelanch)\
**Post date:** [October 22, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/capistrano-errno-connection-refused-connec/117978/1 "2007-10-22T22:54:58Z")

</div>

Hi folks,  
I’m trying to setup with Capistrano 2 and I received this error:  
$ cap deploy:setup

- executing `deploy:setup’
- executing “umask 02 && mkdir -p /var/www/apps/twitter  
/var/www/apps/twitter/releases /var/www/apps/twitter/shared  
/var/www/apps/twitter/shared/system /var/www/apps/twitter/shared/log  
/var/www/apps/twitter/shared/pids”  
servers: [“[twitter.serni.net](http://twitter.serni.net)”]  
[DEBUG] Mon Oct 22 22:49:44 +0200 2007 – transport.session: connecting  
connection failed for: [twitter.serni.net](http://twitter.serni.net) (Errno::ECONNREFUSED:  
Connection refused - connect(2))

Hehehe, I named the test project “twitter” (ough!). I think the problem  
is the ssh port: 33022. For the svn+ssh I made a tunnel at the  
subversion conf file, so, the Capistrano repository config is like this:

set :repository,  
“svn+sernissh://#{domain}/var/www/apps/#{application}/repos/trunk”

Any idea?

Thanks!!  
Xavier

---

<div class="post-metadata">

**Author:** ![xbelanch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/4da419/32.png) [@xbelanch](https://www.ruby-forum.com/u/xbelanch)\
**Post date:** [October 22, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/capistrano-errno-connection-refused-connec/117978/2 "2007-10-22T22:59:26Z")

</div>

On 10/22/07, Xavier B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [DEBUG] Mon Oct 22 22:49:44 +0200 2007 – transport.session: connecting  
> connection failed for: [twitter.serni.net](http://twitter.serni.net) (Errno::ECONNREFUSED:  
> Connection refused - connect(2))
> 
> Hehehe, I named the test project “twitter” (ough!). I think the problem  
> is the ssh port: 33022. For the svn+ssh I made a tunnel at the  
> subversion conf file, so, the Capistrano repository config is like this:

It seems that your server ([twitter.serni.net](http://twitter.serni.net)) isn’t answering (is not  
open).

Also, check the documentation about capistrano recipes on how to  
include the ssh port for each host.

> set :repository,  
> “svn+sernissh://#{domain}/var/www/apps/#{application}/repos/trunk”

svn+sernissh??? I guess SVN will not understand that protocol 😛

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![xbelanch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/4da419/32.png) [@xbelanch](https://www.ruby-forum.com/u/xbelanch)\
**Post date:** [October 22, 2007, 11:17pm UTC](https://www.ruby-forum.com/t/capistrano-errno-connection-refused-connec/117978/3 "2007-10-22T23:17:01Z")

</div>

Luis L. wrote:

> On 10/22/07, Xavier B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > [DEBUG] Mon Oct 22 22:49:44 +0200 2007 – transport.session: connecting  
> > connection failed for: [twitter.serni.net](http://twitter.serni.net) (Errno::ECONNREFUSED:  
> > Connection refused - connect(2))
> > 
> > Hehehe, I named the test project “twitter” (ough!). I think the problem  
> > is the ssh port: 33022. For the svn+ssh I made a tunnel at the  
> > subversion conf file, so, the Capistrano repository config is like this:
> 
> It seems that your server ([twitter.serni.net](http://twitter.serni.net)) isn’t answering (is not  
> open).

Ups, it’s rare, but you’re right! If I make a nmap, doesnt show any ssh  
open port!

> Also, check the documentation about capistrano recipes on how to  
> include the ssh port for each host.
> 
> > set :repository,  
> > “svn+sernissh://#{domain}/var/www/apps/#{application}/repos/trunk”
> 
> svn+sernissh??? I guess SVN will not understand that protocol 😛

Well, jusr said at the first post. “sernissh” is a pattern I write at  
the .subversion conf file to access any port unless 22…

### Section for configuring tunnel agents.

[tunnels]  
sernissh=/usr/bin/ssh -p 33022

Thanks!  
Xavier B.

---

<div class="post-metadata">

**Author:** ![xbelanch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/4da419/32.png) [@xbelanch](https://www.ruby-forum.com/u/xbelanch)\
**Post date:** [December 11, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/capistrano-errno-connection-refused-connec/117978/4 "2007-12-11T17:57:15Z")

</div>

I had the same basic issue with a host that uses 7822 for ssh; fixed  
with info from middle of this page:  
[http://wiki.rubyonrails.org/rails/pages/Capistrano](http://wiki.rubyonrails.org/rails/pages/Capistrano)

Seems easier to just re-create the custom protocol in deploy.rb, thus

set :repository, svn+ssh://user@domain/path/to/repos"  
ssh\_options[:port] = 7822
