# Capistrano =\> can't create tunnel error

**URL:** <https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941>\
**Category:** Deployment\
**Created:** [July 9, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941 "2007-07-09T19:37:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 9, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/1 "2007-07-09T19:37:32Z")

</div>

Hello,

I’m trying to use capistrano deployment on my mediatemple DV server.  
Unfortunately I always get the same “can’t create tunnel” error when  
doing “cap deploy”. I’ve been searching for a solution but it’s really  
driving me nuts. With tortoise (svn+ssh) I’m able to connect to my  
repository without any problems. Can somebody help me?

D:\webroot\mezza\_svn\>cap deploy

- executing task deploy
- executing task update  
\*\* transaction: start
- executing task update\_code
- querying latest revision…  
svn: Can’t create tunnel: The system cannot find the file specified.  
\*\*\* [update\_code] transaction: rollback
- [update\_code] rolling back
- executing “rm -rf /u/apps/mezza/releases/20070709160041”  
servers: [“www.mezza-interieur.be”]  
Password: xxx

\*\* [update\_code] exception while rolling back:  
Net::SSH::AuthenticationFailed,  
Owner  
c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/scm/subversion.rb  
:24:in `latest_revision': Could not determine latest revision (RuntimeError) from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/conf iguration.rb:62:in`initialize’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/conf  
iguration.rb:89:in `call' from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/conf iguration.rb:89:in`[]’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/conf  
iguration.rb:236:in `method_missing' from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/scm/ subversion.rb:63:in`checkout’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/reci  
pes/standard.rb:80:in `load' from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/acto r.rb:159:in`instance\_eval’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/acto  
r.rb:159:in `update_code' ... 13 levels... from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/cli. rb:12:in`execute!’  
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-1.4.1/bin/cap:11  
from c:/ruby/bin/cap:16:in `load’  
from c:/ruby/bin/cap:16

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 9, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/2 "2007-07-09T19:45:33Z")

</div>

Do you have a command-line SSH client installed, such as OpenSSH?

- Jamis

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 9, 2007, 7:51pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/3 "2007-07-09T19:51:46Z")

</div>

Jamis B. wrote:

> Do you have a command-line SSH client installed, such as OpenSSH?
> 
> - Jamis

yes, I’m working with putty. I guess capistrano is trying to connect to  
my repository from my local computer.

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 9, 2007, 8:03pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/4 "2007-07-09T20:03:34Z")

</div>

This is a known problem with putty. One solution is to use cygwin. There  
is  
also (or used to be) a web page out there somewhere that explained how  
to  
configure putty and server so this would work, but I can’t find it right  
now.

On 7/9/07, Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

## –

Andrew S. \* [http://semprebon.blogspot.com/](http://semprebon.blogspot.com/)

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 9, 2007, 7:55pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/5 "2007-07-09T19:55:34Z")

</div>

You might want to check out this article:

[HowTo: Configure SVN+SSH with Subclipse on Windows - Martin Woodward](http://www.woodwardweb.com/java/000155.html)

It’s not cap-specific, but the advice it gives might be applicable,  
since the problem is the same.

- Jamis

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 9, 2007, 8:19pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/6 "2007-07-09T20:19:24Z")

</div>

Andrew S. wrote:

> This is a known problem with putty. One solution is to use cygwin. There  
> is  
> also (or used to be) a web page out there somewhere that explained how  
> to  
> configure putty and server so this would work, but I can’t find it right  
> now.
> 
> On 7/9/07, Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > –  
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > >
> 
> ## –
> 
> Andrew S. \* [http://semprebon.blogspot.com/](http://semprebon.blogspot.com/)

Ok, I tried several things. Changing the ssh var in the subversion  
config file to:  
ssh = C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe -ssh -l  
cpanelid

didn’t work ;( … I also tried adding an environment variable in  
windows. Din’t work eighter.

I’m gonna try cygwin. Hopefully that will work… 🙂 Do I have to  
uninstall putty first? If this is a common problem, why isn’t there much  
information about this? On my other PC I was able to use  
capistrano/svn/putty without any problems.

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 10, 2007, 12:22am UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/7 "2007-07-10T00:22:47Z")

</div>

Andrew S. wrote:

> I don’t think its that common - maybe its a particular version of putty  
> and  
> windows combined or something. I know I tried setting up the config file  
> with plink.exe and that didn’t work, but I can’t remember if I fixed it  
> or  
> not. I ended up going with cygwin.
> 
> On 7/9/07, Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > On 7/9/07, Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > uninstall putty first? If this is a common problem, why isn’t there much
> 
> ## –
> 
> Andrew S. \* [http://semprebon.blogspot.com/](http://semprebon.blogspot.com/)

YES!! … I fixed it. I just restarted windows and then svn accepted the  
plink ssh client :). jezus, took me hours.

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 11, 2007, 3:04pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/8 "2007-07-11T15:04:42Z")

</div>

Hi:

Please review my windows recipe below as I have gotten excellent  
results with it. Getting cap+svn+ssh to all work together on Windows  
is tricky business. Some of the links might be old versions, but this  
should point you in the right direction.

* * *

Here’s what I do to make a working windows environment.

- download and install ruby:  
[http://rubyforge.org/frs/download.php/12751/ruby185-21.exe](http://rubyforge.org/frs/download.php/12751/ruby185-21.exe)

- open command prompt

- change to the bin directory in the ruby installation folder

- update ruby gems by running:  
ruby gem update --system

- install gems (choose mswin32 1.0.1 when faced with mongrel version  
choice)  
gem install rails mongrel mongrel\_cluster capistrano --include-  
dependencies

- close command prompt

- install svn  
[http://subversion.tigris.org/files/documents/15/35379/svn-1.4.2-setup.exe](http://subversion.tigris.org/files/documents/15/35379/svn-1.4.2-setup.exe)

- install putty  
[http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.59-installer.exe](http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.59-installer.exe)  
\<[http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.59-](http://the.earth.li/%7Esgtatham/putty/latest/x86/putty-0.59-)  
installer.exe\>  
inside the putty directory you’ll find putty, puttygen, and pageant.

- Add C:\Program Files\PuTTY to my path (right click my computer,  
properties, advanced, environment variables, edit path system  
variable)

- Edit C:\Documents and Settings\ YourUserName\Application  
Data\Subversion\config in notepad  
Under [tunnels] add:  
ssh=plink

- Generate a key pair using Puttygen and save them.

- Paste the public key in to /home/deploy/.ssh/authorized\_keys  
mkdir ~/.ssh;chmod 700 ~/.ssh  
cat \> ~/.ssh/authorized\_keys  
  
^D  
chmod 600 ~/.ssh/authorized\_keys

- Run Pageant

- Click on the icon in the taskbar and add the private key saved from  
above.

* * *

At this point, everything should work without passwords (svn and  
putty).

Good luck,  
Bradley Taylor  
[http://railsmachine.com](http://railsmachine.com)

On Jul 9, 1:37 pm, Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [July 9, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/capistrano-cant-create-tunnel-error/108941/9 "2007-07-09T20:43:37Z")

</div>

I don’t think its that common - maybe its a particular version of putty  
and  
windows combined or something. I know I tried setting up the config file  
with plink.exe and that didn’t work, but I can’t remember if I fixed it  
or  
not. I ended up going with cygwin.

On 7/9/07, Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > On 7/9/07, Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> uninstall putty first? If this is a common problem, why isn’t there much

## –

Andrew S. \* [http://semprebon.blogspot.com/](http://semprebon.blogspot.com/)
