我无法安装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: command not found
答案 0 :(得分:1)
尝试在Ubuntu上禁用IPv6