我无法安装bundler
。我使用的是Ubuntu 18,并已安装ruby 2.5.1。下面是运行该命令的输出结果:
gem install bundler --debug
NOTE: Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/resolv.rb:170 - LoadError
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:937 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:939 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/timeout.rb:114 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:997 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:306 - timed out (https://api.rubygems.org/api/v1/dependencies)
Exception `Errno::EEXIST' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/fileutils.rb:232 - File exists @ dir_s_mkdir - /home/ikushlianski/.gem/specs/api.rubygems.org%443
Exception `Errno::ENOENT' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:325 - No such file or directory @ rb_file_s_stat - /home/ikushlianski/.gem/specs/api.rubygems.org%443/prerelease_specs.4.8
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:937 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:939 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/timeout.rb:114 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:997 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:306 - timed out (https://api.rubygems.org/prerelease_specs.4.8.gz)
Exception `Errno::EEXIST' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/fileutils.rb:232 - File exists @ dir_s_mkdir - /home/ikushlianski/.gem/specs/api.rubygems.org%443
Exception `Errno::ENOENT' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:325 - No such file or directory @ rb_file_s_stat - /home/ikushlianski/.gem/specs/api.rubygems.org%443/specs.4.8
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:937 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:939 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/timeout.rb:114 - execution expired
Exception `Net::OpenTimeout' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/net/http.rb:997 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:306 - timed out (https://api.rubygems.org/specs.4.8.gz)
Exception `Gem::RemoteFetcher::UnknownHostError' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/spec_fetcher.rb:269 - timed out (https://api.rubygems.org/specs.4.8.gz)
Exception `Gem::UnsatisfiableDependencyError' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/installer_set.rb:72 - Unable to resolve dependency: user requested 'bundler (>= 0)'
ERROR: Could not find a valid gem 'bundler' (>= 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 /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/fileutils.rb:232 - File exists @ dir_s_mkdir - /home/ikushlianski/.gem/specs/api.rubygems.org%443
Exception `Errno::ENOENT' at /home/ikushlianski/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:325 - No such file or directory @ rb_file_s_stat - /home/ikushlianski/.gem/specs/api.rubygems.org%443/latest_specs.4.8
运行 sudo gem install bundler
命令会输出 sudo: gem: 命令未找到
curl https://rubygems.org
看起来工作正常。它会输出一些HTML。 - Ilya Kushlianskigem install whatever
吗? - D1ceWard