4

如果我尝试在我的服务器上安装任何 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 重定向陷阱。

问候,

凯文。

4

3 回答 3

5

我设法用

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
于 2011-03-10T11:16:31.900 回答
0

只需从源代码安装最新版本的 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

应该管用 :)

于 2012-02-27T22:26:41.990 回答
0

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

http://rubygems.org/pages/download

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

于 2013-05-08T07:07:04.287 回答