# Cap2 hangs in the shell

**URL:** <https://www.ruby-forum.com/t/cap2-hangs-in-the-shell/110644>\
**Category:** Deployment\
**Created:** [July 28, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/cap2-hangs-in-the-shell/110644 "2007-07-28T19:18:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [July 28, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/cap2-hangs-in-the-shell/110644/1 "2007-07-28T19:18:53Z")

</div>

Hi,

I’m having trouble with testing/learning capistrano… I failed at the  
first thing I wanted to do… here:

david@local:~$ cap shell HOSTS=server1

- executing `shell’  
====================================================================  
Welcome to the interactive Capistrano shell! This is an experimental  
feature, and is liable to change in future releases. Type ‘help’ for  
a summary of how to use the shell.

* * *

cap\> uname -r  
[establishing connection(s) to server1]

It just hangs here… Let me mention that server1 is defined in hosts  
file and only ssh login with client certificate is enabled. so SSH  
server1 works without me having to type in anything (because the  
certificate has been added to the keyring by ssh-add).

When interrupted (ctrl+c), this pops out:  
/usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/configuration/connections.rb:87:in  
`join': Interrupt from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/configuration/connections.rb:87:in`establish\_connections\_to’  
from  
/usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/configuration/connections.rb:87:in  
`each' from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/configuration/connections.rb:87:in`establish\_connections\_to’  
from  
/usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/shell.rb:135:in  
`connect' from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/shell.rb:148:in`exec’  
from  
/usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/shell.rb:259:in  
`process_command' from /usr/lib/ruby/1.8/thread.rb:135:in`synchronize’  
from  
/usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/shell.rb:259:in  
`process_command' ... 15 levels... from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/cli/execute.rb:14:in`execute’  
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/bin/cap:4  
from /usr/bin/cap:16:in `load’  
from /usr/bin/cap:16

Anyone?

thank you very much!

david

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [July 28, 2007, 7:59pm UTC](https://www.ruby-forum.com/t/cap2-hangs-in-the-shell/110644/2 "2007-07-28T19:59:47Z")

</div>

So, just to make sure, the following command works for you just fine:

david@local:~$ ssh server1 “uname -r”

?

If so, could you do the following:

1. Create a Capfile in the current directory.

2. Add “ssh\_options[:verbose] = :debug” to the Capfile.

3. Save and close the Capfile.

4. Run “cap shell HOSTS=server1” again.

Then, email me (directly, not to the list) whatever was spewed to the  
console as a result of enabling debugging SSH output.

- Jamis

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [July 28, 2007, 10:09pm UTC](https://www.ruby-forum.com/t/cap2-hangs-in-the-shell/110644/3 "2007-07-28T22:09:18Z")

</div>

We isolated the problem with Jamis.

If anyone also bumps into this, here it’s what was happening: I had  
specified the default port for server1 in ssh.conf. Thus “ssh server1”  
worked (and didn’t connect to default port 22). Net::SSH doesn’t  
currently read that conf and tried to connect to 22.

Jamis B. wrote:

> So, just to make sure, the following command works for you just fine:
> 
> david@local:~$ ssh server1 “uname -r”
> 
> ?
> 
> If so, could you do the following:
> 
> 1. Create a Capfile in the current directory.
> 
> 2. Add “ssh\_options[:verbose] = :debug” to the Capfile.
> 
> 3. Save and close the Capfile.
> 
> 4. Run “cap shell HOSTS=server1” again.
> 
> Then, email me (directly, not to the list) whatever was spewed to the  
> console as a result of enabling debugging SSH output.
> 
> - Jamis
