在鞋子应用程序中,我试图从一些内部网站下载东西。我收到这个错误
Error in /tmp/selfgz14214/ruby/lib/net/protocol.rb line 66
undefined method 'closed?' for #<OpenSSL::SSL::SSLSocket:0xb6af94f0>
我收到此代码的上述错误。如果从鞋子中使用,则会出现上述错误。
require 'net/http'
require 'net/https'
require 'rexml/document'
class Blogs
attr_reader :Connection
def initialize
@Connection = Net::HTTP::new("someInternalWebSite", 443)
@Connection.use_ssl = true
end
def get_blogs
doc = REXML::Document.new @Connection.get('/weblogs/feed/entries/atom').body
blogs = Array.new
# ----- some crap to parse the blogs
return blogs
end
end
请注意,此问题仅在从鞋内跑步时发生。
同样在鞋子中使用内置的下载方法,它不会返回,甚至不会引发启动事件。以下是该代码
download "https://internalWebsite/weblogs/feed/entries/atom",
:start => lambda {
alert "hello"
},
:progress => lambda {
alert "progress"
},
:finish => lambda {
alert "finish"
}