upgrade ruby 2.2.1 to 2.2.2

May 31, 2015 6k views
Ruby on Rails Deployment Ruby Git Nginx PostgreSQL Ubuntu

i'm trying to deploy this : https://github.com/catarse/catarse
but problem it required to upgrade ruby to 2.2.2

i have written this command : 'rvm install 2.2.2'
then it give me this output:

ruby-2.2.2 - #removing src/ruby-2.2.2..
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/14.04/x86_64/ruby-2.2.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.2.2, this may take a while depending on your cpu(s)...
ruby-2.2.2 - #downloading ruby-2.2.2, this may take a while depending on your connection...
ruby-2.2.2 - #extracting ruby-2.2.2 to /usr/local/rvm/src/ruby-2.2.2....
ruby-2.2.2 - #configuring.........................................................
ruby-2.2.2 - #post-configuration..
ruby-2.2.2 - #compiling......
Error running '__rvm_make -j1',
showing last 15 lines of /usr/local/rvm/log/1433073602_ruby-2.2.2/make.log
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make: *** [parse.o] Error 4
++ return 2
There has been an error while running make. Halting the installation.
  • i don't have any knowledge with Ruby or RoR , i'm Python (flask/django) programmer , but this repo will save me months of work so i decided to deploy it *
1 comment
  • Bump! - I just encountered the same problem. I checked to ensure that all Ubuntu packages are installed and updated, got the latest version of RVM as well.

1 Answer

This is being caused by your droplet running out of memory, and can be resolved by simply creating a temporary swap file.

All credit goes to Javier at digital ocean support for the cause of this problem. He pointed out that 9 out of 10 times the program cc1 in the line " gcc: internal compiler error: Killed (program cc1) " typically means that the server ran out of memory.

sudo fallocate -l 4G /swapfile    # I used 4gig's for good measure
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

sudo swapon -s                          # Confirm that it is running
Have another answer? Share your knowledge.