navjeetc
By:
navjeetc

capistrano fails for rails application

December 30, 2014 4.3k views

Capistrano deploy tasks keep failing giving the following error:

Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as rails@demo.anakhsoft.com: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
Errno::ENOMEM: Cannot allocate memory - nodejs
(in /home/rails/releases/20141230062531/app/assets/javascripts/active_admin.js.coffee)

Is it a lack of memory issue or something else?

My droplet is 104.236.118.121

1 comment
3 Answers

Glad to hear you got it working! The error:

Errno::ENOMEM: Cannot allocate memory

indeed means that you ran out of memory. Precompiling assets can take a lot of memory. Adding a swap file is a great way to allow yourself a little extra room without needing to scale up the whole server.

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.

Thanks for clarifying the error message.

Have another answer? Share your knowledge.