Closed
Description
Using rubyinstaller to install Ruby 2.2.1-x86 on windows 7 x64 machine. No proxy configured, no firewalls active, no antivirus software installed. Plain direct connection to internet.
c:\work>ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [i386-mingw32]
c:\work>gem -v
2.4.5
Trying to execute any gem network operation fails with
c:\work>gem install --backtrace aws-sdk
ERROR: While executing gem ... (Errno::ENETRESET)
The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. - recvfrom(2)
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:759:in `recvfrom'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:759:in `recv_reply'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:690:in `request'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:528:in `block in fetch_resource'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1096:in `block (3 levels) in resolv'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1094:in `each'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1094:in `block (2 levels) in resolv'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1093:in `each'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1093:in `block in resolv'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1091:in `each'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1091:in `resolv'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:519:in `fetch_resource'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:509:in `each_resource'
c:/Ruby22/lib/ruby/2.2.0/resolv.rb:490:in `getresource'
c:/Ruby22/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:92:in `api_endpoint'
c:/Ruby22/lib/ruby/2.2.0/rubygems/source.rb:46:in `api_uri'
c:/Ruby22/lib/ruby/2.2.0/rubygems/source.rb:85:in `dependency_resolver_set'
c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/best_set.rb:23:in `block in pick_sets'
c:/Ruby22/lib/ruby/2.2.0/rubygems/source_list.rb:97:in `each'
c:/Ruby22/lib/ruby/2.2.0/rubygems/source_list.rb:97:in `each_source'
c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/best_set.rb:22:in `pick_sets'
c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/best_set.rb:28:in `find_all'
c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/installer_set.rb:151:in `find_all'
c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/installer_set.rb:54:in `add_always_install'
c:/Ruby22/lib/ruby/2.2.0/rubygems/dependency_installer.rb:463:in `resolve_dependencies'
c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:238:in `install_gem'
c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:299:in `block in install_gems'
c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:295:in `each'
c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:295:in `install_gems'
c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:202:in `execute'
c:/Ruby22/lib/ruby/2.2.0/rubygems/command.rb:307:in `invoke_with_build_args'
c:/Ruby22/lib/ruby/2.2.0/rubygems/command_manager.rb:168:in `process_args'
c:/Ruby22/lib/ruby/2.2.0/rubygems/command_manager.rb:138:in `run'
c:/Ruby22/lib/ruby/2.2.0/rubygems/gem_runner.rb:54:in `run'
c:/Ruby22/bin/gem:21:in `<main>'
This traces back to line https://github.com/rubygems/rubygems/blob/master/lib/rubygems/remote_fetcher.rb#L94
Maybe windows dns client cannot handle SRV requests(dunno, never looked into the cause of the problem)
This can be fixed if we replace rescue Resolv::ResolvError
with plain rescue
or more specific dns resolve error handling.
Activity
tenderlove commentedon Apr 29, 2015
Wow, I've never seen that exception before. If you rescue
Errno::ENETRESET
, will it work?cyberegg commentedon May 19, 2015
Corporate network, Mcafee (a/v only), no software firewalls, no proxies.
Windows 7 Ult x64
Ruby 2.1.6
Rubygems 2.4.7
gem install anything gave this same error
Tried all sorts of DNS, network, ruby troubleshooting.
Came down to one simple thing: turn the Windows firewall ON.
Turn it OFF, immediately able to reproduce error. Turn it ON and the gems start flowing again. GO FIGURE.
Exact same computer hardware/software build right next to it, no issues retrieving gems with the M$ firewall up or down. Chalking this up to "user customization" of their workstation.
"Nuke it from orbit... only way to be sure." -Hicks
altmind commentedon May 19, 2015
@tenderlove indeed
rescue Errno::ENETRESET
worked. canot retest it, thou.djberg96 commentedon May 24, 2015
I disabled my firewall, but was unable to reproduce this error. I tried various firewall configurations, too. Personally I'd blame McAfee. ;)
Anyway, closing this one out as "unable to reproduce".
aleksey-korolev commentedon Nov 22, 2015
Reproducing it right now on Windows 7 Ult x64 SP1
ruby 2.2.1p85
gem install/update anything gives this error
Have Avast Free Antivirus, diabling it doesn't help. Windows Firewall is off.
Updating to ruby to 2.2.3 doesn't help.
ruby -v
2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
Ruby on Windows is pain...
aleksey-korolev commentedon Nov 25, 2015
Tried same command using same notebook with same software but from another location with another internet provider and the command worked fine, so it might be network infrastructure related thing like MTU size somewhere on a router:
D:\Work>gem update rhc
Updating installed gems
Updating rhc
Fetching: rhc-1.38.4.gem (100%)
If this is your first time installing the RHC tools, please run 'rhc setup'
Successfully installed rhc-1.38.4
Parsing documentation for rhc-1.38.4
Installing ri documentation for rhc-1.38.4
Installing darkfish documentation for rhc-1.38.4
Done installing documentation for rhc after 7 seconds
Parsing documentation for rhc-1.38.4
Done installing documentation for rhc after 3 seconds
Gems updated: rhc
bezaworkmetropolia commentedon Nov 26, 2015
@cyberegg ur method worked for me
rioux602 commentedon Mar 2, 2016
@cyberegg Thanks!!!
Stromweld commentedon Apr 24, 2016
I also found @cyberegg's trick to work. I also found that 2 of my machines were in vmware that were running into this same issue and swapping out the vm nic from intel E1000 to vmxnet3 also fixed this issue with the firewall turned off.
vivekm2017 commentedon Sep 22, 2016
I was running- "gem install berkshelf", I got the same error. So when I ran "gem install bundle" first and then tried the "gem install berkshelf" - it worked!!
BoraDev commentedon Dec 10, 2016
Same here guys. I turned Windows Firewall ON,and it works. How is this possible I don't know. Anyway, @cyberegg ,thanks a lot.
ppjuns commentedon Apr 23, 2017
@cyberegg ,thx it worked for me ,I try the method three times ,after reborn my pc and permit the firewall tip window ,finally it run successfully.
renaatdemuynck commentedon Oct 2, 2017
I had the same problem. Fixed by temporarily disabling my anti-virus (Symantec Endpoint Protection).