Ruby and Rails Development Environment Using Chef and Vagrant

Gogobot Development machine

TL:DR We created a Vagrant+Chef cookbooks combination for provisioning a new laptop for Ruby/Rails development. Fork it here gogobot/devbox.

Our development environment at Gogobot grew a lot over the last 4 years, from a simple rails application reading/writing from a mySQL DB into a full blown application that has many dependencies/micro-services and messaging between different kind of apps.

Over the last 4 years, we had multiple ways for installing the application, when I joined Gogobot it was a Google doc with about 8 pages filled with sudo gem install and multiple configuration that I had to do manually, it took me about 2 days to get everything installed and running.

After a while it became better and we released gogobot/laptop, which was a bit better, but it had many many issues, if one of the processes would fail, you had to start all over and it was very unfriendly, when I installed my new laptop 3 years ago using this script it took a full day to get everything installed and running.

Even today, think about your development environment, you have so many things you did manually

All of these steps live somewhere, usually in some abandoned corner of your brain, you might choose to brew update git or run a newer version of Redis while another member of your team still runs an older version.

We decided it’s not good enough for us anymore and we set out to do it differently.

Goals

Going into this, we had a few goals in mind

  1. Use existing tools already used at Gogobot
  2. Simple to install/use/understand for any team member (Ruby Engineers / iOS / Android / Project,Content,Product people)
  3. Minimal dependencies on host machines (git, Vagrant, Virtualbox)
  4. Easy to re-configure and re-provision
  5. All engineers use the same packages
  6. Absolutely no manual configuration of environments

The finished solution

If you read posts on my blog before, you know we use chef quite extensively at Gogobot, we decided to use chef for this project as well, virtualizing with Vagrant and Virtual box.

Redacted (but fully working) version of the project is now at gogobot/devbox.

Enjoy!

Please feel free to open issues/comment if you are using it or having issues with it.

Discuss on HackerNews here: https://news.ycombinator.com/item?id=8800108

Inspiration/Credits/Thank you’s

Gogobot