1

Trying to install gems always comes up with error. Always have to download them manually thru browser for some reason. Is there something I'm missing here?

Here is install example:

$ gem install mysql2 --debug -V

NOTE: Debugging mode prints all exceptions even when rescued

Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - The system cannot find the file specified.
Exception `Win32::Registry::Error' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0                                                                                      /win32/registry.rb:250 - No more data is available.
Exception `Resolv::ResolvTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/                                                                                      resolv.rb:694 - Resolv::ResolvTimeout
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:880 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:882 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/timeout.rb:112 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/remote_fetcher.rb:297 - timed out (https://api.rubygems.org/api/v1/dependencies)
Exception `Errno::EEXIST' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/fileutils.rb:253 - File exists @ dir_s_mkdir - C:/Users/anking/.gem/specs/api.rubygems.org%443
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:880 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:882 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/timeout.rb:112 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/remote_fetcher.rb:297 - timed out (https://api.rubygems.org/prerelease_specs.4.8.gz)
Exception `Errno::EEXIST' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/fileutils.rb:253 - File exists @ dir_s_mkdir - C:/Users/anking/.gem/specs/api.rubygems.org%443
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:880 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:882 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/timeout.rb:112 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/remote_fetcher.rb:297 - timed out (https://api.rubygems.org/specs.4.8.gz)
Exception `Gem::RemoteFetcher::UnknownHostError' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/spec_fetcher.rb:265 - timed out (https://api.rubygems.org/specs.4.8.gz)
Exception `Gem::UnsatisfiableDependencyError' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:71 - Unable to resolve dependency: user requested 'mysql2 (>= 0)'
ERROR:  Could not find a valid gem 'mysql2' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - timed out (https://api.rubygems.org/specs.4.8.gz)
Exception `Errno::EEXIST' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/fileutils.rb:253 - File exists @ dir_s_mkdir - C:/Users/anking/.gem/specs/api.rubygems.org%443
Exception `Errno::ENOENT' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/remote_fetcher.rb:316 - No such file or directory @ rb_file_s_stat - C:/Users/anking/.gem/specs/api.rubygems.org%443/latest_specs.4.8
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:880 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/net/http.rb:882 - execution expired
Exception `Net::OpenTimeout' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/timeout.rb:112 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/remote_fetcher.rb:297 - timed out (https://api.rubygems.org/latest_specs.4.8.gz)
Exception `Gem::RemoteFetcher::UnknownHostError' at C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/spec_fetcher.rb:265 - timed out (https://api.rubygems.org/latest_specs.4.8.gz)
knut
  • 27,320
  • 6
  • 84
  • 112
AnKing
  • 1,994
  • 6
  • 31
  • 54
  • Are you behind a proxy? (See e.g. https://stackoverflow.com/questions/4418/how-do-i-update-ruby-gems-from-behind-a-proxy-isa-ntlm ) – knut Mar 24 '18 at 23:06
  • I'm not behind a proxy and i can download gems thru browser no problem – AnKing Mar 25 '18 at 13:23
  • 1
    It could be related to ipV6 issues with rubygems.org, see: http://help.rubygems.org/discussions/problems/31074-timeout-error – ipd Jun 04 '18 at 21:47

1 Answers1

1

This question is 7 months old now. As ipd references, on both Mac and Windows, temporarily disabling the IPv6 stack allowed my bundle install request to complete without hiccup.

Screenack
  • 747
  • 10
  • 26