Gem repository not found when installing rails

谁说我不能喝 提交于 2020-01-04 02:53:31

问题


I have Ruby 1.8.7 and Ruby 1.9.2 installed on my Windows Machine.

In my console when I do ruby -v it gives me Ruby 1.8.7

Now when I try

gem install rails -v 2.3.8

I get this error

ERROR:  http://gems.rubyforge.org/ does not appear to be a repository
ERROR:  could not find gem rails locally or in a repository

My RubyGems version show 1.3.5 so I tried to update it

gem update --system

I get this error

Updating RubyGems
ERROR:  http://gems.rubyforge.org/ does not appear to be a repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::E10013: An attempt was made to access a socket in a way forbidden by
its access permissions. - connect(2) (http://gems.rubyforge.org/yaml)`

What is going wrong?


回答1:


Give this a try.

gem sources 

That will show you what sources you are using.

gem sources -a http://rubygems.org
gem sources -a http://gems.github.com
gem sources -a http://gems.rubyforge.org/

Those will add the most used gem sources.




回答2:


I got the same error, but when I tried to set the company's proxy with SET HTTP_PROXY, I got a problem because the proxy uses NTLM validation and I needed to specify my AD-Domin which won't work wit gem. The way I got around it was installing fiddler and starting it and then setting

SET HTTP_PROXY=http://localhost:8888

afterwards my gems installed like a charm!



来源:https://stackoverflow.com/questions/4825178/gem-repository-not-found-when-installing-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!