Installing berkshelf on AWS t2.micro

30 Nov 2014 18:26

This is part of my quest to sort out my website. Installing berkshelf on a t2.micro.

If you use sudo gem install berkshelf on an AWS t2.micro, you will run out of memory. This is because dep-selector-libgecode (a berkshelf dependency) takes about 2GB of RAM while compiling.

In fact, on a t2.small, you’re likely to run out of memory as well, or you’ll get bored waiting for it to finish compiling. To get around this, pick one of the following options:

  • Use an instance type with more RAM.
  • Install ChefDK, instead of using gems. This includes a bunch of stuff that you might not want, but it is the simplest option.
  • Use berks vendor on a beefier computer, and commit the cookbooks to your chef-repo.
  • Use a system-installed libgecode instead. Unfortunately, dep-selector-libgecode requires Gecode version 3, and Ubuntu 14.04 provides version 4.