Ruby:尝试安装gems或更新系统超时(Gem::RemoteFetcher::FetchError)

ffscu2ro  于 2023-04-20  发布在  Ruby
关注(0)|答案(1)|浏览(288)

你好我试图安装宝石,但rubygems不断超时

  • Ruby 3.0.5p211 [ruby 3.0.5p211 [x86_64-linux]]

当:

gem update --system

我得到这个:

ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Net::OpenTimeout: Net::OpenTimeout (https://rubygems.org/specs.4.8.gz)

输出:

gem update --verbose --debug --system
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_require.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_rubygems.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_rubygems.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1466 - No such file or directory @ apply2files - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_rubygems.rb
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_rubygems.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1466 - No such file or directory @ apply2files - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener.rb
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener_response.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener_response.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1466 - No such file or directory @ apply2files - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener_response.rb
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/test_webauthn_listener_response.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/utilities.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/utilities.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1466 - No such file or directory @ apply2files - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/utilities.rb
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/utilities.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert.pem
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert.pem
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1466 - No such file or directory @ apply2files - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert.pem
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert.pem
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert_32.pem
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert_32.pem
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1466 - No such file or directory @ apply2files - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert_32.pem
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/rubygems/wrong_key_cert_32.pem
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/test_changelog_generator.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1332 - No such file or directory @ rb_file_s_lstat - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/test_changelog_generator.rb
Exception `Errno::ENOENT' at /usr/share/ruby/fileutils.rb:1466 - No such file or directory @ apply2files - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/test_changelog_generator.rb
Exception `Errno::EEXIST' at /usr/share/ruby/fileutils.rb:253 - File exists @ dir_s_mkdir - /home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test
/home/ec2-user/.gem/ruby/gems/rubygems-update-3.4.12/test/test_changelog_generator.rb
Exception `Errno::EEXIST' at /usr/share/rubygems/rubygems/installer.rb:950 - File exists @ dir_s_mkdir - /home/ec2-user/bin
/home/ec2-user/bin/update_rubygems
Exception `Errno::EEXIST' at /usr/share/rubygems/rubygems/installer.rb:950 - File exists @ dir_s_mkdir - /home/ec2-user/.gem/ruby/plugins
Successfully installed rubygems-update-3.4.12
Parsing documentation for rubygems-update-3.4.12
Parsing sources...
100% [14/14]  hide_lib_for_update/note.txt
Done installing documentation for rubygems-update after 0 seconds
Parsing documentation for rubygems-update-3.4.12
Parsing sources...
100% [14/14]  hide_lib_for_update/note.txt
Done installing documentation for rubygems-update after 0 seconds
Exception `Errno::ENOENT' at /usr/share/rubygems/rubygems/commands/update_command.rb:176 - No such file or directory @ dir_chdir - /usr/share/gems/gems/rubygems-update-3.4.12
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory @ dir_chdir - /usr/share/gems/gems/rubygems-update-3.4.12
        /usr/share/rubygems/rubygems/commands/update_command.rb:176:in `chdir'
        /usr/share/rubygems/rubygems/commands/update_command.rb:176:in `install_rubygems'
        /usr/share/rubygems/rubygems/commands/update_command.rb:289:in `update_rubygems'
        /usr/share/rubygems/rubygems/commands/update_command.rb:93:in `execute'
        /usr/share/rubygems/rubygems/command.rb:323:in `invoke_with_build_args'
        /usr/share/rubygems/rubygems/command_manager.rb:180:in `process_args'
        /usr/share/rubygems/rubygems/command_manager.rb:149:in `run'
        /usr/share/rubygems/rubygems/gem_runner.rb:53:in `run'
        /usr/bin/gem:21:in `<main>'

在互联网上寻找,我发现ipv6可能是一个问题,我disbled它,但它不断超时
我希望有人能指引我正确的方向,我不是一个Ruby的家伙

9o685dep

9o685dep1#

我通过使用RVM 1- Uninstall Ruby重新安装Ruby解决了这个问题:

~$ sudo yum remove ruby

使用rvm.io中的命令获取项目密钥并运行安装脚本

~$ gpg2 --recv-keys key1 key2
~$ curl -sSL https://get.rvm.io | bash -s stable

安装RVM:

\curl -sSL https://get.rvm.io | bash -s stable

相关问题