Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A virtual machine for Ruby on Rails development
Perl Puppet Ruby
Branch: master
Pull request Compare This branch is 65 commits behind brennovich:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
puppet
.gitignore
.gitmodules
README.md
Vagrantfile

README.md

A Development environment based on Ruby on Rails devbox

Introduction

This project automates the setup of a development environment for Ruby on Rails. This is the easiest way to build a box with everything ready to start hacking, all in an isolated virtual machine.

Requirements

How To Build The Virtual Machine

Building the virtual machine is this easy:

host $ git clone --recursive https://github.com/brennovich/brotodevbox.git
host $ cd brotodevbox
host $ vagrant up

That's it.

If the base box is not present that command fetches it first. The setup itself takes about 3 minutes in my MacBook Air. After the installation has finished, you can access the virtual machine with

host $ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
...
vagrant@rails-dev-box:~$

Port 3000 in the host computer is forwarded to port 3000 in the virtual machine. Thus, applications running in the virtual machine can be accessed via localhost:3000 in the host computer.

What's In The Box

  • Git
  • Ruby 1.9.3 [Ubuntu package]
  • rbenv
  • Bundler
  • SQLite3, MySQL, and Postgresql
  • System dependencies for nokogiri, sqlite3, mysql, mysql2, and pg
  • therubyracer
  • Memcached
  • dotfiles

Recommended Workflow

The recommended workflow is

  • edit in the host computer and
  • test within the virtual machine.

Vagrant mounts that very directory as /vagrant within the virtual machine:

vagrant@brotodevbox:~$ ls /vagrant
puppet  rails  README.md  Vagrantfile

so we are ready to go to edit in the host, and test in the virtual machine.

This workflow is convenient because in the host computer one normally has his editor of choice fine-tuned, Git configured, and SSH keys in place.

Virtual Machine Management

When done just log out with ^D and suspend the virtual machine

host $ vagrant suspend

then, resume to hack again

host $ vagrant resume

Run

host $ vagrant halt

to shutdown the virtual machine, and

host $ vagrant up

to boot it again.

You can find out the state of a virtual machine anytime by invoking

host $ vagrant status

Finally, to completely wipe the virtual machine from the disk destroying all its contents:

host $ vagrant destroy # DANGER: all is gone

Please check the Vagrant documentation for more information on Vagrant.

Something went wrong with that request. Please try again.