【问题标题】:Bundle Update stuck at "Fetching source index for http://rubygems.org/"Bundle Update 卡在“Fetching source index for http://rubygems.org/”
【发布时间】:2011-06-16 07:32:25
【问题描述】:

截至昨天,我无法更新我的捆绑包。它卡在“获取http://rubygems.org/ 的源索引”。我知道这通常是takes a while,但我已经等了几个小时并在最后一天尝试了几次。我有 20 Mbit 的互联网连接。

我在 Macbook 上使用 gem 1.8.5、Bundler 版本 1.0.15、rvm 0.1.46、ruby-1.9.2-p0 [ x86_64 ] 和 Rails 3.0.8。宝石文件:https://gist.github.com/1028832

我尝试运行 Bundle Update 的原因是因为直到最近,bundle 才设置为 rake 0.8.7(不知道为什么),但 rake 开始要求我升级到 0.9.2。所以我改变了Gemfile。 Bundle Install 告诉我:

  bundle install
  Fetching source index for http://rubygems.org/
  You have requested:
  rake >= 0.9.2

  The bundle currently has rake locked at 0.8.7.
  Try running `bundle update rake`

我的.bundle/config 包含:

---
BUNDLE_DISABLE_SHARED_GEMS: "1"
BUNDLE_WITHOUT: production

我没有使用代理。

我什至尝试删除 Gemfile.lock,在 rvm 中重新安装 ruby​​ 版本并删除所有 gem:

rm Gemfile.lock
rvm uninstall 1.9.2
rvm install 1.9.2
for x in `gem list --no-versions`;do gem uninstall $x -aIx;done
gem install bundle
bundle install

【问题讨论】:

  • Sjors,如果您尝试手动安装 gems,会发生什么? http代理可能有问题吗?或者您的 .bundle/config 中的某些内容?
  • 我试图让它使用 rake 0.9.2 而不是 1.8.7,由于某种原因,它以前在 Gemfile 中被硬编码。这两个版本都已安装在系统上。
  • 如果你真的被卡住了。尝试删除您的 Gemfile.lock,然后重试
  • @mark 是的,我实际上在我的问题中链接到它。应该需要几分钟,而不是几小时。

标签: ruby-on-rails rubygems bundler


【解决方案1】:

注释掉所有 gem 并为 rails(例如 3.0.8)和 rake(例如 0.9.2)设置显式版本。然后只需运行 rake、cucumber 和 server 即可查看您真正需要哪些 gem,并手动将它们一一添加。

【讨论】:

  • 只需将版本放回 Rails 就为我做到了。
【解决方案2】:

我在“Fetching source index for http://rubygems.org/”遇到了同样的问题

在我的情况下,它是通过使用 ruby​​gems 现代索引而不是 API 端点来解决的:

bundle install --full-index

【讨论】:

    【解决方案3】:

    我检查了 Gemfile.lock 并将特定版本(例如 ~> 1.3.0)添加到 Gemfile 中没有的 gem。发现比逐个取消注释宝石更快。

    通过 gem 执行接受的答案并取消注释 gem,我发现错误是由于不兼容的 gem 依赖项造成的。可能解析算法陷入了循环。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-26
      • 2023-03-07
      • 2015-07-07
      • 1970-01-01
      • 2021-06-30
      相关资源
      最近更新 更多