gpt4 book ai didi

ruby-on-rails - 频繁出现 Gem RemoteFetcher::FetchError。任何解决方法?

转载 作者:数据小太阳 更新时间:2023-10-29 06:55:18 27 4
gpt4 key购买 nike

最近几天我每天都经常收到这个错误...

$ gem install rails -v 3.2.1
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Forbidden 403 (http://production.cf.rubygems.org/gems/rdoc-3.12.gem)

我的理解基于 previous question这是由于远程存储库出现问题,解决方案是稍等片刻,然后重试。事实上,有时当我等待几个小时或过夜时,安装命令会起作用。

但是,我希望获得更可靠的体验。

我想到了下载rails-3.2.1.gem等文件然后运行...

$ gem install --local ~/Desktop/rails-3.2.1.gem

但这给了我...

$ gem install --local ~/Desktop/rails-3.2.1.gem 
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: rails requires railties (= 3.2.1)

我可以尝试下载 railties。也许我会。但我感觉自己掉进了一个兔子洞,整天都在寻找一个又一个依赖。

安装 gems 的任何替代有效方法?我可以通过我的存储库规范做些什么来让 gem 安装更可靠吗?


$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.2.0]
- INSTALLATION DIRECTORY: /Users/ethan/.rvm/gems/ruby-1.9.2-p290@rails_3_for_mtc
- RUBY EXECUTABLE: /Users/ethan/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/ethan/.rvm/gems/ruby-1.9.2-p290@rails_3_for_mtc/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/ethan/.rvm/gems/ruby-1.9.2-p290@rails_3_for_mtc
- /Users/ethan/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://rubygems.org"]
- "gem" => "--no-rdoc --no-ri"
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- http://rubygems.org

最佳答案

确保您的 rvm ssl 证书是最新的。

检查他们的状态

$ rvm osx-ssl-certs status all

更新它们!

$ rvm osx-ssl-certs update all

关于ruby-on-rails - 频繁出现 Gem RemoteFetcher::FetchError。任何解决方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9237201/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com