J
Just Another Victim of the Ambient Morality
Inexplicably, the following code fails:
http = Net::HTTP.new("somesite.com")
puts http.get("/")[1]
...with this error:
ruby/1.8/net/http.rb:925:in '[]': undefined method 'downcase' for 1:Fixnum
(NoMethodError)
from web.rb:5
Now, I do have access to a Linux system with Ruby 1.6 and it sometimes
succeeds but often fails with this error:
/usr/lib/ruby/1.6/net/protocol.rb:221:in `error!': 403 "Forbidden"
(Net:rotoFatalError)
from /usr/lib/ruby/1.6/net/http.rb:1217:in `value'
from /usr/lib/ruby/1.6/net/http.rb:605:in `get'
from ./web.rb:16
How is this possible? How can it sometimes succeed and sometimes fail?
Why can't this reliably work?
Thank you...
http = Net::HTTP.new("somesite.com")
puts http.get("/")[1]
...with this error:
ruby/1.8/net/http.rb:925:in '[]': undefined method 'downcase' for 1:Fixnum
(NoMethodError)
from web.rb:5
Now, I do have access to a Linux system with Ruby 1.6 and it sometimes
succeeds but often fails with this error:
/usr/lib/ruby/1.6/net/protocol.rb:221:in `error!': 403 "Forbidden"
(Net:rotoFatalError)
from /usr/lib/ruby/1.6/net/http.rb:1217:in `value'
from /usr/lib/ruby/1.6/net/http.rb:605:in `get'
from ./web.rb:16
How is this possible? How can it sometimes succeed and sometimes fail?
Why can't this reliably work?
Thank you...