Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install any gems

Tags:

ruby

rubygems

gem

I have been doing JavaScript and some Erlang for around six months and I haven't done any Rails programming lately. Today on my new PC I went to install Rails but got this error:

gem install rails
WARNING:  RubyGems 1.2+ index not found for:
        http://gems.rubyforge.org/

RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: htp://gems.rubyforge.org/
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    Error fetching remote gem cache: SocketError: getaddrinfo: The system cannot
 find the file specified.  (http://gems.rubyforge.org/yaml)

A friend of mine said: "gem -v?" to which I responded "1.3.5". He suggested I update to 1.3.6 but I had the same problem. Then I installed a few gems for testing purposes from github.

I don't know if I'm missing a source or something, or if something changed drastically in gems.

Also:

gem sources -a htp://gemcutter.org/
Error fetching htp://gemcutter.org/:
        SocketError: getaddrinfo: The system cannot find the file specified. (http://gemcutter.org/specs.4.8.gz)
like image 304
user290145 Avatar asked Mar 10 '10 02:03

user290145


2 Answers

For Mac OSX the solution that worked for me was:

sudo gem install rubygems-update   --source http://production.s3.rubygems.org/
sudo gem update --system           --source http://production.s3.rubygems.org/

It comes from some file on github of all places.

like image 51
Adam Greenhall Avatar answered Nov 11 '22 23:11

Adam Greenhall


Try reinstalling rubygems from scratch here: http://rubygems.org/pages/download

RubyForge has been deprecated and may no longer be working properly. The other possibility is that when you tried to do this rubyforge or gemcutter was down, or otherwise not accessible over your network. You can also try seeing if you can reach the file on rubygems by entering it in your browser (to test your network): http://gemcutter.org/specs.4.8.gz

This question has previously been asked here: RubyGems 1.2+ index not found for:. It appears the problem was that rubyforge was blocked by China's firewall.

Good luck!

like image 30
Gdeglin Avatar answered Nov 12 '22 00:11

Gdeglin