Skip to content

Using a VM for development

starrb edited this page Nov 21, 2013 · 14 revisions

Rather than installing and running RapidFTR directly on your workstation/laptop/what-have-you, you can develop using a virtual machine. This will get you up and running more quickly than trying to install the components yourself. Performance may be slower than if you run "native." We'd recommend starting with a VM and setting up RapidFTR natively only once you understand a bit about how the system works and only if you find the performance of the VM annoying.

The development VM is run using Vagrant, which uses VirtualBox. It should work regardless of the OS you're running (Mac OS X, Linux, or Windows) so long as you have VirtualBox installed.

Here are the instructions to get up and running.

  • Set up Vagrant using these instructions, stopping before running any command starting with vagrant (in the section "Your First Vagrant Virtual Environment") so that you have VirtualBox and Vagrant installed.
  • Clone the RapidFTR repository. git clone git://github.com/rapidftr/RapidFTR.git or for read-write access to your own fork, fork the RapidFTR repository and then git clone git@github.com:duelinmarkers/RapidFTR.git substituting your own git username after the colon.
  • From the root of the RapidFTR clone, run vagrant up to download and boot the VM.
    • Beware, the box file is large (about 300MB). It should only have to download once.
    • The first time vagrant up is run the Chef recipes will be executed to provision the VM, this may take some time.
    • Once that command completes, the VM is running, headless, in the background.
  • vagrant ssh to log into the VM. (You can do this from as many terminal windows as you like.)
  • cd /vagrant
  • rvm --create use 1.9.3-p392@rapidftr
  • bundle install
  • Follow the instructions for Initial Seeding and Running starting from If you have not yet created admin username/password for CouchDB
    • The software will already be installed on the VM and CouchDB started automatically so the steps under Make sure and Start CouchDB are not necessary if using the VM
    • The commands should be run from the /vagrant folder on the VM
  • Once the Rails server is running on the VM the RapidFTR website can be accessed from the standard port via a web browser on the host machine (http://localhost:3000/)
  • CouchDB is automatically started on the VM and does not need to be started manually. It can be accessed from the standard port via a web browser on the host machine (http://localhost:5984/).
  • Shut down the server with Ctrl-C (or open a new terminal window, go to your working directory, and use vagrant ssh to open a new connection).

When you're finished working on RapidFTR for a bit, you'll want to shut down the box.

  • vagrant suspend will save the current running state of the machine. You can come back up from this with vagrant resume.
  • vagrant halt will shut down the machine. You can come back up from this with vagrant up.

If you want to trash the VM completely (and recover disk space), use vagrant destroy. After doing this you'll need to download the box again to run it again.

Clone this wiki locally