开发者

gem install returns FloatDomainError Infinity or NaN

On Ubuntu 10.10, I cannot install any gems!

$ 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)

Ok, so the proxy is in the way :-

$ 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) This is where it returned the cursor to, not a new line?! It does this on every call below as well.

Get the same with another gem :-

$ sudo gem install --http-proxy=http://username:password@proxy:8080 twitter
ERROR:  While executing gem ... (FloatDomainError)
    NaN
Fetching: hashie-0.4.0.gem

I have trie开发者_如何学God -p as well!

But myhttp_proxyenv var is setup correctly :-

$ env | grep http
http_proxy=http://username:password@proxy.com:8080

As stuff like this works :-

$ 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)
...

And all theapt-get&curlcommands go straight though without problems.

Versions :-

$ 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

Any help/ideas?


Try not to use the Ubuntu package of Ruby or RubyGems. Ideally, remove those packages with apt-get uninstall and start from scratch with rvm (Ruby Version Manager).

When using rvm, it's usually best to install gems locally (a.k.a., do not use sudo and system-wide installs).

A good write up on all of this is Ryan Bigg's blog post Ubuntu, Ruby, RVM, Rails, and You.


We had a similar issue behind a company gateway. It went fine on the WiFi at the hotel. My guess is it is the virus scan on the company gateway.


This appears to be a bug in RubyGems 1.4.2. See this GemCutter Help page for more details.

If you want to try out the latest build from trunk that fixes this, feel free to checkout Rubygems from source and install manually:

$> 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 out
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜