【问题标题】:Gem Update System - Catch 22 with 302 redirectsGem 更新系统 - Catch 22 和 302 重定向
【发布时间】:2011-03-10 10:47:19
【问题描述】:

如果我尝试在我的服务器上安装任何 gem,则会收到 302 重定向,例如

gem install clickatell -V
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
HEAD http://rubygems.org/specs.4.8.gz
connection reset after 2 requests, retrying
HEAD http://rubygems.org/specs.4.8.gz
302 Found

一篇关于 ruby​​gems 的文章建议进行 gem update --system

http://help.rubygems.org/kb/rubygems/why-do-i-get-http-response-302-or-301-when-installing-a-gem

gem update --system -V
Updating RubyGems
GET 302 Found: http://gems.rubyforge.org/latest_specs.4.8.gz
connection reset after 2 requests, retrying
HEAD 302 Found: http://gems.rubyforge.org/specs.4.8.gz
connection reset after 2 requests, retrying
HEAD 302 Found: http://gems.rubyforge.org/yaml
ERROR:  http://gems.rubyforge.org/ does not appear to be a repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: Connection timed out - connect(2) (http://gems.rubyforge.org/yaml)

这当然只是 gem 本身的更新。

我正在运行 ruby​​gems 1.3.1 最新版本是1.6.1

有没有一种方法可以更新 Rubygems 而不会陷入我的 302 重定向陷阱。

问候,

凯文。

【问题讨论】:

    标签: ruby rubygems gem


    【解决方案1】:

    我设法用

    更新了 ruby​​gems
    gem update --system -l -V --source http://production.cf.rubygems.org                            
    Updating RubyGems
    GET http://production.cf.rubygems.org/latest_specs.4.8.gz
    200 OK
    Updating rubygems-update
    Installing gem rubygems-update-1.6.1
    Using local gem /home/passenger/.rvm/gems/ruby-1.8.7-p249/cache/rubygems-update-1.6.1.gem
    

    这并没有解决我在任何其他 gem 上遇到的 302 错误。

    要直接安装 gems,您可以按照以下步骤操作:

    1. go to http://rubygems.org/, search for 'your-gem', and copy the link
    2. wget http://rubygems.org/downloads/your-gem.gem
    3. gem install ./your-gem.gem --local
    

    【讨论】:

    • 您最终找到解决方案了吗?我陷入了同样的难题。
    • 实际上,在我为我的 Ruby 1.8.6 安装完成 gem update --system --source production.cf.rubygems.org 之后,gem update 现在可以工作了。 :) 旧的 Gem 版本是 0.9.4,现在我有 1.3.6
    【解决方案2】:

    只需从源代码安装最新版本的 ruby​​gems(目前最新版本是 1.8.17):

        wget http://http://production.cf.rubygems.org/rubygems/rubygems-1.8.17.tgz
        tar -xzvf rubygems-1.8.17.tgz
        cd rubygems-1.8.17.tgz
        sudo ruby setup.rb
    

    应该工作:)

    【讨论】:

    • 然后运行 ​​gem install rails -V (这样你就可以看到现在一切是多么美好和完美)
    【解决方案3】:

    按照 ruby​​gems.org 的说明进行操作:

    http://rubygems.org/pages/download

    我发现手动安装可以帮助我获得最新的 gem (RubyGems)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-25
      • 2011-01-18
      • 2017-09-20
      • 1970-01-01
      • 2010-11-04
      • 2015-11-14
      相关资源
      最近更新 更多