Closed jasonrclark closed 9 years ago
I'd need a better stacktrace to even begin to look at this.
Following's the stack trace when I run this script (using a more recent JRuby 1.7).
Also tested it on JRuby 9k, and it works fine there for what that's worth.
~/source/shoes4:cat testing/hurley.rb
require 'hurley'
Hurley.get("http://github.com")
✔ ♥♥♥♥ [jruby-1.7.22] (master)*
~/source/shoes4:jruby testing/hurley.rb
TypeError: can't convert Net::ReadAdapter into String
initialize at org/jruby/ext/stringio/StringIO.java:143
get at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1041
transport_request at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1331
reading_body at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:2680
transport_request at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1330
catch at org/jruby/RubyKernel.java:1242
transport_request at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1325
request at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1302
request at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1295
start at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:746
request at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1293
get at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb:1035
perform_request at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/connection.rb:80
call at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/connection.rb:15
initialize at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/client.rb:252
call at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/connection.rb:14
net_http_connection at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/connection.rb:58
call at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/connection.rb:12
call_with_redirects at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/client.rb:122
call_with_redirects at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/client.rb:127
call at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/client.rb:89
get at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/hurley-0.2/lib/hurley/client.rb:47
get at /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/forwardable.rb:201
(root) at testing/hurley.rb:2
That seems to be coming from inside net/http. Can you post /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/1.9/net/http.rb
to a gist or something?
Interesting. Confirmed that my local copy of that file is identical to the code at this tag in the JRuby repo: https://github.com/jruby/jruby/blob/1.7.22/lib/ruby/1.9/net/http.rb
FWIW this seems to be a ruby 1.9 bug: https://bugs.ruby-lang.org/issues/9467
I fixed it by skipping that net/http method that adds gzip encoding support for ruby 1.9 in #29. I'll push out a new release once the next two PRs are taken care of.
Checked it out locally against master, and it worked great. Thanks @technoweenie!
Hey there! Ran the following steps to see whether
hurley
would allow me past a redirection limitation I was hitting withopen-uri
, but instead ran into this error:Works fine if I run on MRI 2.1.5, but unfortunately my target app is JRuby-based.
JRuby version: