英文:
Ruby : Trying to install gems or update the system times out Gem::RemoteFetcher::FetchError)
问题
你好,我正在尝试安装gems,但rubygems一直超时。
- 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
在互联网上查找后,我发现IPv6可能是问题,我已禁用它,但仍然超时。希望有人能指导我正确的方向,我不是一个Ruby专家。
英文:
Hi im trying to install gems but the rubygems keeps timing out
- ruby 3.0.5p211 [ruby 3.0.5p211 [x86_64-linux]]
when :
gem update --system
i get this :
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Net::OpenTimeout: Net::OpenTimeout (https://rubygems.org/specs.4.8.gz)
the output of :
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>'
looking in the internet i found out that ipv6 could be a problem
i disbled it but it keeps timing out
i hope someone can guide me to the right direction , im ot a ruby guy
答案1
得分: 1
我通过使用RVM重新安装Ruby解决了这个问题。
1- 卸载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
英文:
I resolved the problem by re-insatlling Ruby using RVM
1- Uninstall Ruby :
~$ sudo yum remove ruby
Use the commands at rvm.io to get the project keys and run the installation script
~$ gpg2 --recv-keys key1 key2
~$ curl -sSL https://get.rvm.io | bash -s stable
Install RVM:
\curl -sSL https://get.rvm.io | bash -s stable
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论