我是红宝石新手。我有以下代码片段,它执行 GET 操作并检索我的 facebook 组的名称
def get_groups
query=("SELECT gid,name FROM group where gid in(SELECT gid from group_member where uid=me)")
uri=URI("https://graph.facebook.com/fql")
params={'q'=>query,'access_token'=>TOKEN}
uri.query=URI.encode_www_form(params)
response=Net::HTTP.get_response(uri)
result=json.loads(response.text)
return result['data']
end
但是当我执行上面的代码时,我得到以下错误:
/usr/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock': Connection reset by peer (Errno::ECONNRESET)
from /usr/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
from /usr/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
from /usr/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
from /usr/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
from /usr/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
from /usr/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
from /usr/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
from /usr/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
from /usr/lib/ruby/1.9.1/net/http.rb:1293:in `request'
from /usr/lib/ruby/1.9.1/net/http.rb:1195:in `request_get'
from /usr/lib/ruby/1.9.1/net/http.rb:455:in `block in get_response'
from /usr/lib/ruby/1.9.1/net/http.rb:745:in `start'
from /usr/lib/ruby/1.9.1/net/http.rb:454:in `get_response'
from fb.rb:12:in `get_groups'
from fb.rb:32:in `<main>'
我在这里犯了什么错误?