11155
(-- --)
March 11, 2015, 2:46pm
1
I need to call third party API in my rails app. I decide to use open-uri
(but also tried the NET::HTTP.get and gives me the same error), and to
this:
open("http://www.example.org ") do |f|
puts f.base_uri #=> http://www.example.org
puts f.status #=> ["200", "OK"]
end
But it gives me:
getaddrinfo: Name or service not known
I can't come up with a solution
So it's unable to resolve the host name. Either you've got the name wrong, or there's something in your OS config preventing it from being resolved correctly.
11155
(-- --)
March 11, 2015, 3:00pm
3
Scott Ribe wrote in post #1169990:
11155
(-- --)
March 11, 2015, 3:05pm
4
Stupid me! It was a permission problem on the resolv.conf file! thanks
anyway!