# Net::FTP problem with localhost

**URL:** <https://www.ruby-forum.com/t/net-ftp-problem-with-localhost/135600>\
**Category:** Ruby\
**Created:** [April 23, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/net-ftp-problem-with-localhost/135600 "2008-04-23T14:33:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![threeeyedfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a587f6/32.png) [@threeeyedfish](https://www.ruby-forum.com/u/threeeyedfish)\
**Post date:** [April 23, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/net-ftp-problem-with-localhost/135600/1 "2008-04-23T14:33:07Z")

</div>

Good day all!

I’ve started an FTP server on localhost:8021.  
Other clients (I’ve tried wget) connect successfully.  
Net:FTP.open(‘localhost:8021’) raises an exception:

SocketError: getaddrinfo: nodename nor servname provided, or not known

It is ruby 1.8.6 on Mac OS X 10.5 Leopard.  
Could anyone please help me identify the source of the problem and give  
me any advice?

---

<div class="post-metadata">

**Author:** ![threeeyedfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a587f6/32.png) [@threeeyedfish](https://www.ruby-forum.com/u/threeeyedfish)\
**Post date:** [April 23, 2008, 5:05pm UTC](https://www.ruby-forum.com/t/net-ftp-problem-with-localhost/135600/2 "2008-04-23T17:05:47Z")

</div>

On Wed, Apr 23, 2008 at 7:33 AM, Damian T.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Good day all!
> 
> I’ve started an FTP server on localhost:8021.  
> Other clients (I’ve tried wget) connect successfully.  
> Net:FTP.open(‘localhost:8021’) raises an exception:

Look at the connect method.

Untested:

ftp = Net::FTP.new  
ftp.connect(host, port)  
ftp.login(user, password)

hope that helps,

Gordon

---

<div class="post-metadata">

**Author:** ![threeeyedfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a587f6/32.png) [@threeeyedfish](https://www.ruby-forum.com/u/threeeyedfish)\
**Post date:** [April 23, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/net-ftp-problem-with-localhost/135600/3 "2008-04-23T17:49:02Z")

</div>

> Look at the connect method.
> 
> hope that helps,

Thank you very much, Gordon.  
That indeed saved the situation.

Damian
