Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 5 commits ahead, 100 commits behind rails:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

A Virtual Machine for Ruby on Rails Core Development

Changes on this fork

  • Removed MySQL.
  • postgres user connection is trusted (e.g. no need for password).
  • Ruby version 2.1.2.


This project automates the setup of a development environment for working on Ruby on Rails itself. Use this virtual machine to work on a pull request with everything ready to hack and run the test suites.

Please note this virtual machine is not designed to be used for Rails application development.


How To Build The Virtual Machine

Building the virtual machine is this easy:

host $ git clone
host $ cd rails-dev-box
host $ vagrant up

That's it.

(If you want to use VMWare Fusion instead of VirtualBox, write vagrant up --provider=vmware_fusion instead of vagrant up when building the VM for the first time. After that, Vagrant will remember your provider choice, and you won't need to include the provider flag again.)

(If you want to use Parallels Desktop instead of VirtualBox, you need Vagrant 1.5+, and write vagrant up --provider=parallels instead of vagrant up when building the VM for the first time. After that, Vagrant will remember your provider choice, and you won't need to include the provider flag again.)

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)

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

  • RVM

  • Ruby 2.1.1 (binary RVM install)

  • Bundler

  • SQLite3, MySQL, and Postgres

  • System dependencies for nokogiri, sqlite3, mysql, mysql2, and pg

  • Databases and users needed to run the Active Record test suite

  • Node.js for the asset pipeline

  • Memcached

The recommended workflow is

  • edit in the host computer and

  • test within the virtual machine.

Just clone your Rails fork into the rails-dev-box directory on the host computer:

host $ ls   Vagrantfile puppet
host $ git clone<your username>/rails.git

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

vagrant@rails-dev-box:~$ ls /vagrant
puppet  rails  Vagrantfile

Install gem dependencies in there:

vagrant@rails-dev-box:~$ cd /vagrant/rails
vagrant@rails-dev-box:/vagrant/rails$ bundle

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 you normally have your 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


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.

Faster Rails test suites

The default mechanism for sharing folders is convenient and works out the box in all Vagrant versions, but there are a couple of alternatives that are more performant.


Vagrant 1.5 implements a sharing mechanism based on rsync that dramatically improves read/write because files are actually stored in the guest. Just throw

config.vm.synced_folder '.', '/vagrant', type: 'rsync'

to the Vagrantfile and either rsync manually with

vagrant rsync

or run

vagrant rsync-auto

for automatic syncs. See the post linked above for details.


If you're using Mac OS X or Linux you can increase the speed of Rails test suites with Vagrant's NFS synced folders.

With a NFS server installed (already installed on Mac OS X), add the following to the Vagrantfile:

config.vm.synced_folder '.', '/vagrant', type: 'nfs' 'private_network', ip: '' # ensure this is available


host $ vagrant up

Please check the Vagrant documentation on NFS synced folders for more information.


Released under the MIT License, Copyright (c) 2012–ω Xavier Noria.


A virtual machine for Ruby on Rails core development







No releases published


No packages published


  • Puppet 64.5%
  • Ruby 35.5%