[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

SocketError: getaddrinfo: nodename nor servname provided, or

Baq Haidri

5/6/2008 10:07:00 PM

I'm trying to use Net/Http and am getting the following error:

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

I'm on Mac OS X, Leopard, check out my ruby version/gem env below.

Also, I double checked my etc/hosts and I do see an entry for
localhost/127.0.0.1 there. Seems like this is a Leopard issue?

[baq@baq:~]$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]

[baq@baq:~]$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.0.1 (1.0.1)
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111)
[universal-darwin9.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBYGEMS PREFIX:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby
- RUBY EXECUTABLE:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-9
- GEM PATHS:
-
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- /Library/Ruby/Gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rub...
--
Posted via http://www.ruby-....

6 Answers

Michael Boutros

5/7/2008 12:16:00 AM

0

Can we pleas see the code that is causing this error?
--
Posted via http://www.ruby-....

Baq Haidri

5/7/2008 12:21:00 AM

0

Here's the code:

require 'net/http'
Net::HTTP.start('http://www.googl...) do |http|
response = http.get('/')
puts response
end







--
Posted via http://www.ruby-....

Michael Boutros

5/7/2008 12:35:00 AM

0

Try this:

require 'net/http'
Net::HTTP.start('www.google.com') do |http|
response = http.get('/')
puts response
end


#start doesn't take the protocol.
--
Posted via http://www.ruby-....

Baq Haidri

5/7/2008 12:47:00 AM

0

Great, that did it!

Thanks Michael! (and I apologize to everyone who was spammed with this
message--I *did* do a google search & doc search but couldn't find a
solution...)

Michael Boutros wrote:
> Try this:
>
> require 'net/http'
> Net::HTTP.start('www.google.com') do |http|
> response = http.get('/')
> puts response
> end
>
>
> #start doesn't take the protocol.

--
Posted via http://www.ruby-....

duke

6/24/2012 1:38:00 PM

0

On Sat, 23 Jun 2012 22:21:22 -0400, Mr.B1ack <bw@barrk.net> wrote:

>duke <duckgumbo32@cox.net> wrote:
>
>>On Fri, 22 Jun 2012 22:22:38 -0400, Mr.B1ack <bw@barrk.net> wrote:
>>
>>>duke <duckgumbo32@cox.net> wrote:
>>>
>>>>On Thu, 21 Jun 2012 18:15:52 -0400, Mr.B1ack <bw@barrk.net> wrote:
>>>>
>>>>>Uergil <Uergil@uer.net> wrote:
>>>>>
>>>>>>In article <v746u7doanduvao847ttqr252be6g9vp6f@4ax.com>,
>>>>>> duke <duckgumbo32@cox.net> wrote:
>>>>>>
>>>>>>> Actually, it's a matter of man recognizing that there is one greater than he.
>>>>>>
>>>>>>While for every person there is almost certainly another person who is
>>>>>>'greater' in some way, that does not mean that for every person there is
>>>>>>another person who is 'greater' in every way.
>>>>>
>>>>> One day, after we've boosted our IQs to around 500
>>>>> and have better tech
>>
>>>>You can't do that, and never will
>>
>>> Nonsense. They're making progress already - and
>>> when the knowledge bank reaches a critical mass
>>> you're REALLY gonna see something.
>>
>>Yeah, they will explode in a nuclear blast.
> Just because they're smarter ? Interesting theory.

God doesn't care what goes to critical mass. When it does, ducking for help.

>>>>>WE - mere humans - are going to be doing things like creating universes
>>>>Now that's dreaming - making one's self equal to God.
>>> Skip the 1950's B-movie themes OK ... ? When we
>>> can do it, we WILL do it - and it'll be OK.

>>I bet you $10 to a donut that it won't happen before the sun blinks out.

> We'll both have to contract with Alcor then ... but
> it's gonna be expensive to be frozen for 5 billion
> years ....

Then we don't need to worry about super-chinese.

>>> Hmmm ... these days, rich guys buy islands, 150
>>> years from now they may purchase their very own
>>> universes.
>>>>Ain't ever gonna happen,
>>> Yep. Is.

>>You're a dreamer, and an impossible dreamer to boot.

> Care to explain why it's "impossible" to boost IQ,
> eventually double and triple it ??? We're as smart
> as we are because our brains are 'just so'. We're
> busy unraveling the details of this 'just so' -
> and when enough details are found we'll know exactly
> what genetic buttons to push to make it MORE So.

HowStuffWorks "What constitutes a person's IQ?"
Your IQ score is relatively stable, no matter what education you acquire. This
does not mean that you can't increase your intelligence. IQ tests are only one
imperfect method of measuring certain aspects of intellectual ability

>>>>little dummy. The solar system will burn out first well you get much further
>>>>than you are today.
>>> Not.
>>> You just HOPE so, so yer 'god' won't be de-throned
>>> by used-universe salesmen.
>>
>>What a joke.
>
> You're telling a lot of 'em lately ....
> Come out of the dark ages and into the light.

Your bulb is burned out.

The dukester, American-American
*****
"The Mass is the most perfect form of Prayer."
Pope Paul VI
*****

Uergil

6/24/2012 9:47:00 PM

0

In article <vb5eu7hl451646hmdjgfope4rkve58ov8v@4ax.com>,
duke <duckgumbo32@cox.net> wrote:

> I can't offer anything else. I believe; you don't.
>
> If you're right, me - no win, you - no win.
> If I'm right, ME - WIN, you - lose.

Except that eternity with the kind of a god the bible describes might be
worse than any hell.
--
"Ignorance is preferable to error, and he is less
remote from the- truth who believes nothing than
he who believes what is wrong.
Thomas Jefferson