# Net/ssh debug errors

**URL:** <https://www.ruby-forum.com/t/net-ssh-debug-errors/136056>\
**Category:** Ruby\
**Created:** [April 28, 2008, 2:44pm UTC](https://www.ruby-forum.com/t/net-ssh-debug-errors/136056 "2008-04-28T14:44:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [April 28, 2008, 2:44pm UTC](https://www.ruby-forum.com/t/net-ssh-debug-errors/136056/1 "2008-04-28T14:44:44Z")

</div>

=begin  
Hey all,

Code some code here that --works–, only that running it with the debug  
option throws up some errors. I’ understand that net/ssh requires  
openssl, which I have built, but maybe it’s in a non-standard  
location. Can anyone throw some light on this?

gem list --local

\*\*\* LOCAL GEMS \*\*\*

needle (1.3.0)  
Needle is a Dependency Injection/Inversion of Control container for  
Ruby. It supports both type-2 (setter) and type-3 (constructor)  
injection. It takes advantage of the dynamic nature of Ruby to  
provide a rich and flexible approach to injecting dependencies.

net-ssh (1.1.2)  
Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.

sources (0.0.1)  
This package provides download sources for remote gem installation

I have built the openssl with `make && make install`, no other options.

ls ~/proj/build/packages/openssl-snapshot-20040726/  
dep openssl\_missing.c ossl\_bn.c ossl\_config.h ossl\_hmac.c  
ossl\_pkcs12.c ossl\_pkey\_dsa.c ossl\_ssl.h ossl\_x509ext.c  
ruby\_missing.h  
extconf.rb openssl\_missing.h ossl\_bn.h ossl\_digest.c  
ossl\_hmac.h ossl\_pkcs12.h ossl\_pkey.h ossl\_version.h  
ossl\_x509.h  
GNUmakefile ossl\_asn1.c ossl.c ossl\_digest.h ossl\_ns\_spki.c  
ossl\_pkcs7.c ossl\_pkey\_rsa.c ossl\_x509attr.c ossl\_x509name.c  
lib ossl\_asn1.h ossl\_cipher.c ossl\_engine.c ossl\_ns\_spki.h  
ossl\_pkcs7.h ossl\_rand.c ossl\_x509.c ossl\_x509req.c  
Makefile ossl\_bio.c ossl\_cipher.h ossl\_engine.h ossl\_ocsp.c  
ossl\_pkey.c ossl\_rand.h ossl\_x509cert.c ossl\_x509revoked.c  
MANIFEST ossl\_bio.h ossl\_config.c ossl.h ossl\_ocsp.h  
ossl\_pkey\_dh.c ossl\_ssl.c ossl\_x509crl.c ossl\_x509store.c

Here’s the code. Note that it does work but just throwing up errors.

=end

#!/usr/bin/env ruby -d

# -_- mode: ruby -_-

=begin  
Wed Apr 23 15:49:42 BST 2008  
=end

require ‘rubygems’  
require ‘net/ssh’

Net::SSH.start(‘localhost’) do |session|  
p “new session started on localhost”  
session.open\_channel do |channel|  
p “we have a new channel open on localhost”  
channel.close  
end  
session.loop  
end

**END**

results…

ruby -d ssh-channels.rb  
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- net/ssh Exception`Errno::ENOENT’ at  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/known-hosts.rb:60

- No such file or directory - /home/jayeola/.ssh/known\_hosts2  
Exception `Errno::ENOENT’ at  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/known-hosts.rb:60
- No such file or directory - /etc/ssh/ssh\_known\_hosts  
Exception `Errno::ENOENT’ at  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/known-hosts.rb:60
- No such file or directory - /etc/ssh/ssh\_known\_hosts2  
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- termios Exception`LoadError’ at  
/usr/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:34 - no such file  
to load – termios  
Exception `Errno::ENOENT’ at  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/known-hosts.rb:60
- No such file or directory - /home/jayeola/.ssh/known\_hosts2  
Exception `Errno::ENOENT’ at  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/known-hosts.rb:60
- No such file or directory - /etc/ssh/ssh\_known\_hosts  
Exception `Errno::ENOENT’ at  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/known-hosts.rb:60
- No such file or directory - /etc/ssh/ssh\_known\_hosts2  
“new session started on localhost”  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/connection/driver.rb:392:  
warning: instance variable @processing\_data\_requests not initialized  
“we have a new channel open on localhost”  
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/connection/channel.rb:495:  
warning: instance variable @on\_close not initialized

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [April 29, 2008, 12:38pm UTC](https://www.ruby-forum.com/t/net-ssh-debug-errors/136056/2 "2008-04-29T12:38:37Z")

</div>

On Mon, Apr 28, 2008 at 2:44 PM, John M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> lib ossl\_asn1.h ossl\_cipher.c ossl\_engine.c ossl\_ns\_spki.h ossl\_pkcs7.h ossl\_rand.c ossl\_x509.c ossl\_x509req.c
> 
> ```
> p "we have a new channel open on localhost"
> 
> ```
> 
> ruby -d ssh-channels.rb  
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/connection/driver.rb:392: warning: instance variable @processing\_data\_requests not initialized  
> “we have a new channel open on localhost”  
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/connection/channel.rb:495: warning: instance variable @on\_close not initialized

I guess that’s because in debug mode you even the caught exceptions.  
So no need to worry.
