On Feb 3, 11:15 am, Dave Thomas <d... / pragprog.com> wrote:
> For at least the last week, 1.9 HEAD has been unable to install gems.
> The problem seems to be with open-uri:
>
> irb(main):002:0> f = open("http://gems.rubyforge.org/yaml")
> NoMethodError: undefined method `[]=' for nil:NilClass
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:411:in
> `meta_add_field'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:326:in `block in
> open_http'
>         from /usr/local/rubybook/lib/ruby/1.9.0/net/http.rb:1297:in `block in
> each_header'
>         from /usr/local/rubybook/lib/ruby/1.9.0/net/http.rb:1296:in `each'
>         from /usr/local/rubybook/lib/ruby/1.9.0/net/http.rb:1296:in
> `each_header'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:326:in `open_http'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:735:in
> `buffer_open'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:197:in `block in
> open_loop'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:195:in `catch'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:195:in `open_loop'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:141:in `open_uri'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:637:in `open'
>         from /usr/local/rubybook/lib/ruby/1.9.0/open-uri.rb:33:in `open'

Looks like the same problem I reported a couple months ago -- and was
delightfully told it was designed that way :-/

While it may be another issue with a like result, but if it is the one
I mentioned, the problem is the use of respond_to? in open-uri.rb.

T.