builder.rb:48 - Cannot allocate memory

Hi,

I'm having a very strange error I've never seen before when I try: gem
install mongrel

Here is the output with --debug turned on:

root@hebrardmedia:~/software/ruby.1.8.6/ruby-1.8.6# gem install
mongrel --debug
Exception `NameError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/
command_manager.rb:133 - uninitialized constant
Gem::Commands::InstallCommand
Exception `Gem::LoadError' at /usr/local/lib/ruby/site_ruby/1.8/
rubygems.rb:499 - Could not find RubyGem sources (> 0.0.1)

Exception `IOError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/
format.rb:50 - closed stream
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/
test
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/
test
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/
test
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/
test
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/ext/
fastthread
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/ext/
fastthread
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243
- File exists - /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1
Building native extensions. This could take a while...
Exception `Errno::ENOMEM' at /usr/local/lib/ruby/site_ruby/1.8/
rubygems/ext/builder.rb:48 - Cannot allocate memory - /usr/local/bin/
ruby extconf.rb install mongrel --debug 2>&1
Exception `Gem::Installer::ExtensionBuildError' at /usr/local/lib/ruby/
site_ruby/1.8/rubygems/installer.rb:410 - ERROR: Failed to build gem
native extension.

/usr/local/bin/ruby extconf.rb install mongrel --debug

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/
fastthread-1.0.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/
ext/fastthread/gem_make.out

ERROR: Error installing mongrel:
        ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install mongrel --debug

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/
fastthread-1.0.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0.1/
ext/fastthread/gem_make.out
root@hebrardmedia:~/software/ruby.1.8.6/ruby-1.8.6#

I'm running Ubunutu 7.04 with ruby 1.8.6 and gems 1.1.0.

I hope there is any easy fix for this :confused: Debian/Ubuntu and ruby just
never play nice!

Thanks in advance,
Johnny.