2010-02-28 111 views
0

Net :: HTTP提供了一個「未定義的方法」關閉?對於零:NilClass「如果服務器關閉......這是我可以信任的標準響應嗎?它不應該引發一個淨:*異常?服務器關閉時Ruby HTTP中斷

問候

+0

什麼是堆棧跟蹤,什麼Ruby的版本? –

+3

你(或某個地方的某個地方)試圖在一個沒有「nil」的對象上調用一個關閉的方法。所以我們需要一些代碼和堆棧跟蹤來幫助你進一步。因爲沒有上下文,這個錯誤是相當無益的。 –

回答

0

它應該返回是這樣的:

/usr/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: Name or service not known (SocketError) 
from /usr/lib/ruby/1.8/net/http.rb:560:in `open' 
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect' 
from /usr/lib/ruby/1.8/timeout.rb:53:in `timeout' 
from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout' 
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect' 
from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start' 
from /usr/lib/ruby/1.8/net/http.rb:542:in `start' 
from /usr/lib/ruby/1.8/net/http.rb:374:in `get_response' 
from /usr/lib/ruby/1.8/net/http.rb:356:in `get' 
from httpd.rb:2