views:

1039

answers:

8

Problem: Cannot install any gem, any type. But I want to install riddle if that matters.

When I run sudo gem install "gem_name" I get the following error:

WARNING:  RubyGems 1.2+ index not found for:

RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: http://gems.rubyforge.org/

What to do??

A: 

Try to add the another gem source. For example github:

sudo gem sources -r http://gems.rubyforge.org
sudo gem sources -a http://gems.github.com
demas
The problem is not a source problem. I have both of those sources added.The problem is with "index not found for". I don't know what that means, but this is the problem.Thanks for your response.
Sam
A: 

You are running an old RubyGems version. Upgrade to the latest RubyGems 1.3.x branch.

$ rubygems update --self

If it doesn't work (RubyGems 1.2.0 has a weird bug that prevents --self update) then install rubygems_update

$ wget http://rubyforge.org/frs/download.php/60717/rubygems-update-1.3.5.gem
$ gem install rubygems-update-1.3.5.gem
$ update_rubygems

Use sudo if your os requires it.

Simone Carletti
No, that didn't work. Same problem. RubyGems 1.2+ index not found for: then blank.......
Sam
WHich is your gem version now?
Simone Carletti
sorry this took so long. RubyGems 1.3.5
Sam
+2  A: 

Check your sources

gem sources

rebuild index for affected sources, e.g.

gem generate_index http://gems.rubyforge.org
Steve Graham
I get this:Gem::Indexer requires that the XML Builder library be installed: gem install builder
Sam
I installed builder manually, but same error. Index not found for and then blank...
Sam
try `sudo gem install -s http://rubyforge.org/frs/download.php/21724/builder-2.1.2.gem builder`
Steve Graham
sorry missed that second comment.
Steve Graham
what platform are you using?
Steve Graham
mac osx 10.5.1 I tried with your last comment and get not in gzip format
Sam
what type of reinstall did you do? Archive and install, or erase and install. I would also advise checking if your disk permissions need repairing.
Steve Graham
+3  A: 

1) Here is the answer!!!! - slow connection

2) Solution - move to a new connection.

- This might not affect people in the 1st world, but I live in China and this was a huge problem as few people seem to have experienced this.

Basically the error means that the connection is to slow and gives up saying no index found. But there is not documentation or help out there on this, except for a few posts about changing gem sources, and MERB causing problems, but all that failed for me.

Sam
A: 

Could be a daft entry in /etc/hosts...

Sardathrion
+1  A: 

I was having the same problem and ran the following:

gem env

And saw that I had the following sources in my rubygems configuration:

Based on other answers I've seen here and on the web I decided to remove the rubyonrails.org reference:

sudo gem sources -r http://gems.rubyonrails.org

I was then able to install the gem I was trying to get without the RubyGems 1.2+ index error.

So I'd suggest trimming your list of sources down to just rubyforge and github and then trying to install the gem you want.

spilth
A: 

I'm seeing similar errors running jRuby 1.4.0 :

The solution worked for me too!

I'm not in China, but apparently either my employer's network connection is too slow (quite possible) or there is a firewall blocking gems somehow (even more possible).

The more I experiment with this, the more I suspect that this is a firewall issue. Does anyone know what sorts of firewall rules the "gem" command might be breaking here?

Even something as simple as the following seems to result in the error :

c:> jruby -S gem update --system

-Rooby Nooby

A: 

I am having the same problem, and i am tired of googling without any results :(, i have disabled all the firewalls, quit all sources added just some others, but nothing! i cant even install rails from shell....

Edgar Gonzalez