Error while running gem update

Discussion in 'Ruby' started by hweeboon@gmail.com, May 2, 2005.

  1. Guest

    I've just installed Ruby 1.8.2 on Mac OS X Panther, followed by RubyGem
    0.8.10.1. When I try to run "gem update" or "sudo gem update" I get the
    following error:

    ===========
    ERROR: While executing gem ... (Errno::ECONNRESET)
    Connection reset by peer
    ===========

    I re-ran it and with the option --backtrace* and traced the offending
    lines to:

    ===========
    def read_size(uri)
    require 'net/http'
    require 'uri'
    u = URI.parse(uri)
    http = connect_to(u.host, u.port)
    path = (u.path == "") ? "/" : u.path
    resp = http.head(path)
    ===========

    Now I start up irb and run

    ===========
    h = Net::HTTP.new("gems.rubyforge.org", 80)
    r=h.head('/yaml')
    ===========

    I get the same error as above. And if I run the following, I get a good
    response:

    ===========
    h = Net::HTTP.new("motionobj.com", 80)
    r=h.head('/index.htm')
    ===========

    I'm not behind a proxy and I can access http://gems.rubyforge.org/yaml
    with a browser (Safari). Does anyone know why? Thanks.


    * why are the options specified at the end of the line instead of after
    the command? Took me a while to realise that...


    HweeBoon
     
    , May 2, 2005
    #1
    1. Advertising

  2. Assaph Mehr Guest

    wrote:
    > I've just installed Ruby 1.8.2 on Mac OS X Panther, followed by

    RubyGem
    > 0.8.10.1. When I try to run "gem update" or "sudo gem update" I get

    the
    > following error:
    >
    > ===========
    > ERROR: While executing gem ... (Errno::ECONNRESET)
    > Connection reset by peer
    > ===========
    >
    > I re-ran it and with the option --backtrace* and traced the offending
    > lines to:
    >
    > ===========
    > def read_size(uri)
    > require 'net/http'
    > require 'uri'
    > u = URI.parse(uri)
    > http = connect_to(u.host, u.port)
    > path = (u.path == "") ? "/" : u.path
    > resp = http.head(path)
    > ===========
    >
    > Now I start up irb and run
    >
    > ===========
    > h = Net::HTTP.new("gems.rubyforge.org", 80)
    > r=h.head('/yaml')
    > ===========
    >
    > I get the same error as above. And if I run the following, I get a

    good
    > response:
    >
    > ===========
    > h = Net::HTTP.new("motionobj.com", 80)
    > r=h.head('/index.htm')
    > ===========
    >
    > I'm not behind a proxy and I can access

    http://gems.rubyforge.org/yaml
    > with a browser (Safari). Does anyone know why? Thanks.


    Are you sure you're not behind a proxy? I get good results on both
    options.
    In the past I've had the same problem where the corporate proxy was
    mangling the head requests. Patching it to use #get worked, albeit
    slower.
    See
    http://rubyforge.org/pipermail/rubygems-developers/2005-February/001381.html.
     
    Assaph Mehr, May 3, 2005
    #2
    1. Advertising

  3. Guest

    Thanks for replying. If you mean changing from head to get solves the
    problem, I've just tried it, nope. The thing is.. if I can view /yaml
    from the browser (with no proxy set), why can't I do the same with
    Net::HTTP? Is there any difference?

    HweeBoon
     
    , May 3, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. han
    Replies:
    1
    Views:
    123
    Lyle Johnson
    Oct 24, 2005
  2. Stephan Mueller

    gem update for additional gem servers?

    Stephan Mueller, Nov 19, 2006, in forum: Ruby
    Replies:
    3
    Views:
    100
    Jan Svitok
    Nov 20, 2006
  3. Austin 7873
    Replies:
    5
    Views:
    191
    Eric Hodel
    Jan 27, 2007
  4. Lost Warrior
    Replies:
    0
    Views:
    91
    Lost Warrior
    Apr 12, 2008
  5. Markus Fischer
    Replies:
    4
    Views:
    349
    Nick Klauer
    Mar 27, 2011
Loading...

Share This Page