# Help with net/ssh

**URL:** <https://rubytalk.org/t/help-with-net-ssh/39435>\
**Category:** ruby-talk\
**Created:** [26 July 2007 14:54 UTC](https://rubytalk.org/t/help-with-net-ssh/39435 "2007-07-26T14:54:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Dev](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@Jay\_Dev](https://rubytalk.org/u/Jay_Dev)\
**Post date:** [26 July 2007 14:54 UTC](https://rubytalk.org/t/help-with-net-ssh/39435/1 "2007-07-26T14:54:24Z")

</div>

hey guys,  
I'm new to Ruby and Rails. I posted this in Rails forum, but I'm also  
posting here. Hopefully it isn't a big deal.  
My setup is Locomotive on Mac OS X.

When I try to run the below code, I get the below error. What do you  
guys think?

Code:  
require 'net/ssh'

session = Net::SSH.start( 'host', 'username', 'passwd')

puts 'successful'  
session.close

Output:

~/Documents/Programs/Ruby/Depot$ ruby ssh\_test.rb  
ssh\_test.rb:1:in `require': no such file to load -- net/ssh (LoadError)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from ssh\_test.rb:1

Thanks,  
Dev

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

---

<div class="post-metadata">

**Author:** ![Andre\_Ferreira](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@Andre\_Ferreira](https://rubytalk.org/u/Andre_Ferreira)\
**Post date:** [26 July 2007 15:01 UTC](https://rubytalk.org/t/help-with-net-ssh/39435/2 "2007-07-26T15:01:33Z")

</div>

hi Jay,

probably you need to also to

'require rubygems'

André

Jay Dev wrote:

> **···**
>
> > hey guys,  
> > I'm new to Ruby and Rails. I posted this in Rails forum, but I'm also  
> > posting here. Hopefully it isn't a big deal.  
> > My setup is Locomotive on Mac OS X.
> > 
> > When I try to run the below code, I get the below error. What do you  
> > guys think?
> > 
> > Code:  
> > require 'net/ssh'
> > 
> > session = Net::SSH.start( 'host', 'username', 'passwd')
> > 
> > puts 'successful'  
> > session.close
> > 
> > Output:
> > 
> > ~/Documents/Programs/Ruby/Depot$ ruby ssh\_test.rb  
> > ssh\_test.rb:1:in `require': no such file to load -- net/ssh (LoadError)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from ssh\_test.rb:1
> > 
> > Thanks,  
> > Dev
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Jay\_Dev](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@Jay\_Dev](https://rubytalk.org/u/Jay_Dev)\
**Post date:** [26 July 2007 15:06 UTC](https://rubytalk.org/t/help-with-net-ssh/39435/3 "2007-07-26T15:06:54Z")

</div>

Hi Andre,  
Thanks for the reply.  
That worked!!  
I added require 'rubygems' in the first line.

Thanks.

Andre Ferreira wrote:

> **···**
>
> > hi Jay,
> > 
> > probably you need to also to
> > 
> > 'require rubygems'
> > 
> > André
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
