Kevin Monk
Kevin Monk

Reputation: 1454

Gem Update System - Catch 22 with 302 redirects

If I try to install any gem on my server then I get a 302 redirect e.g.

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

An article on rubygems suggests doing a 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)

which is of course just an update of the gem itself.

I'm running rubygems 1.3.1 The latest version is 1.6.1

Is there a way I can update Rubygems without getting caught in my 302 redirect trap.

Regards,

Kevin.

Upvotes: 4

Views: 2587

Answers (3)

Krešimir Prcela
Krešimir Prcela

Reputation: 4281

Follow instructions from rubygems.org:

http://rubygems.org/pages/download

I found there manual installation that helps me to get the latest gem (RubyGems)

Upvotes: 0

Sam Grondahl
Sam Grondahl

Reputation: 2467

Just install the newest version of rubygems from source (most current right now is 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

Should work :)

Upvotes: 0

Kevin Monk
Kevin Monk

Reputation: 1454

I managed to update rubygems with

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

This didn't solve the 302 errors that I get on any other gem though.

To install the gems directly you can follow these steps:

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

Upvotes: 5

Related Questions