在Ubuntu10.10上,我不能安装任何宝石!
$ sudo gem install rails
ERROR: http://rubygems.org/ does not appear to be a repository
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
too many connection resets (http://rubygems.org/latest_specs.4.8.gz)好吧,那么代理是在阻碍:-
$ sudo gem install -p http://username:password@the.proxy.com:8080 rails
ERROR: While executing gem ... (FloatDomainError)
NaN
Fetching: activesupport-3.0.3.gem(1)1)这是它返回光标的地方,而不是新行?!它在下面的每一个电话上都会这样做。
另一颗宝石也是如此:-
$ sudo gem install --http-proxy=http://username:password@proxy:8080 twitter
ERROR: While executing gem ... (FloatDomainError)
NaN
Fetching: hashie-0.4.0.gem我也试过-p了!
但是正确设置了我的http_proxyenv :-
$ env | grep http
http_proxy=http://username:password@proxy.com:8080就像这样的东西:-
$ gem list -r rails
*** REMOTE GEMS ***
rails (3.0.3)
rails-action-args (0.1.1)
rails-admin (0.0.0)
rails-app-installer (0.2.0)
rails-app-spec (0.3.2)
...所有的theapt-get&curlcommands都没有问题。
版本:-
$ ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
$ which ruby
/usr/bin/ruby
$ whereis ruby
ruby: /usr/bin/ruby1.8 /usr/bin/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1.gz
$ rvm list
rvm rubies
ree-1.8.7-2010.02 [ i386 ]
ruby-1.9.2-p136 [ i386 ]
$ rvm -v
rvm 1.2.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
$ gem -v
1.4.2
$ which gem
/usr/bin/gem
$ whereis gem
gem: /usr/bin/gem /usr/bin/gem1.8 /usr/share/man/man1/gem.1.gz有什么帮助/想法吗?
发布于 2011-01-14 17:45:43
尽量不要使用Ruby或RubyGems的Ubuntu包。理想情况下,用apt-get uninstall删除这些包,然后用rvm ( remove )从头开始。
当使用rvm时,通常最好在本地安装gems (即.a.不要使用sudo和系统范围的安装)。
所有这些都写得很好,这是Ryan的博客文章Ubuntu,Ruby,RVM,Rails和你。
发布于 2011-01-15 01:32:26
我们在公司网关背后也有类似的问题。在酒店的WiFi上一切顺利。我猜是公司网关上的病毒扫描。
发布于 2011-01-22 13:43:33
这似乎是RubyGems 1.4.2中的一个bug。有关更多细节,请参见此GemCutter帮助页面。
如果您想试用最新版本的主干来修复这个问题,可以从源代码中签出Rubygems,然后手动安装:
$> git clone https://github.com/rubygems/rubygems.git
$> cd rubygems
$> ruby setup.rb
$> gem env // You should see RubyGems 1.5.0 or something similar if you've installed it
$> gem update // or `gem install` or whatever you want to test outhttps://stackoverflow.com/questions/4692432
复制相似问题