Bundle install gets killed

Posted September 30, 2016 13.1k views
Ruby on RailsUbuntu


I have been following this tutorial on how to get started with Ruby on Rails:

But got stuck when running bundle install, the install gets killed halfway…

root@X:/home/rails/sample_tasks# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from
Fetching version metadata from
Fetching dependency metadata from
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.1
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2

Any ideas on how to resolve?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

It’s because you are running out of memory.
Try adding more swap:
Or bump up to a bigger droplet.

by Etel Sverdlov
Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on Ubuntu 12.04

Great, bumping up to 1GB RAM resolved the issue.
It was the gem nokogiri that broke the install.
Thank you for your fast response!

Adding more swap was the correct answer! Thank you so much!