EOFError:Net :: HTTP文件到达末尾问题
我正在使用ruby-1.8.7-p302 / Rails 2.3.11。我正在尝试使用FQL(Facebook API)来获取链接的统计信息。这是我的代码: def stats(fb_post_url) url = BASE_URI + "?query=#{URI.encode("select like_count from link_stat where url=\"#{fb_post_url}\"")}" parsed_url = URI.parse(url) http = Net::HTTP.new(parsed_url.host, parsed_url.port) request = Net::HTTP::Get.new(parsed_url.request_uri) response = http.request(request) response.inspect end 这是错误: EOFError: end of file reached from /home/rahul/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/protocol.rb:135:in `sysread' from /home/rahul/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/protocol.rb:135:in `rbuf_fill' from /home/rahul/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/timeout.rb:67:in `timeout' from /home/rahul/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/timeout.rb:101:in `timeout' …