Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to install ruby via RVM on an Ubuntu VPS with only 512 MB memory.

When running rvm install 1.9.3 I get the error:

ERROR: Error running 'make ', please read /home/matt/.rvm/log/ruby-1.9.3-p0/make.log

In the log file is the following:

[2012-01-01 03:34:26] make 
    CC = gcc
    LD = ld
    LDSHARED = gcc -shared
    CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=poi
nter-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration  -fPIC
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
    DLDFLAGS = -Wl,-soname,libruby.so.1.9  
    SOLIBS = -lpthread -lrt -ldl -lcrypt -lm  
compiling parse.c
virtual memory exhausted: Cannot allocate memory
make: *** [parse.o] Error 1

Is there a way I can tell rvm to limit the amount of memory it uses for compiling?

share|improve this question
add comment

1 Answer

Make sure you have adequate swap space. You can also try removing the -O3 and hoping for the best. Do you know what VPS software they're using?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.