Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Using Vagrant

Tim Morgan edited this page Mar 3, 2019 · 14 revisions

Vagrant is great. With it you can easily get OneBody running on your local PC or Mac without having to install all the necessary software. You can be hacking on open source software in only a few minutes!

Vagrant is free and runs on Windows, Mac, and Linux. It works by launching a virtual machine with Ubuntu Linux on it and running OneBody there. But don't worry -- most of the time you don't have to think about this running VM, as everything is pretty automatic.

Install Vagrant and Launch the App

  1. Install VirtualBox. It's free and it runs on Windows, Mac, and Linux.
  2. Install Vagrant on your host machine.
  3. Install Git.
  4. Clone the repository to your host machine: git clone git://github.com/churchio/onebody.git
  5. In your host terminal, change to the project directory: cd onebody
  6. Run vagrant: vagrant up

View the App in Your Browser

Visit the site running in development mode at localhost:3000.

Use Your Favorite Editor

You can use your favorite text editor to make changes inside the onebody directory on your host machine (no need to edit anything "inside" the running VM). Changes should show in your browser after refreshing.

Updating Gems & Running Migrations

Whenever gems are updated or new migrations are needed, you can just run vagrant provision.

Getting a Terminal Inside the VM

To gain access to the vagrant box terminal, run vagrant ssh to get an active SSH session. Once inside, the OneBody directory is mirrored at /vagrant inside the Vagrant box.

Restarting the Rails Server

To restart the Rails server, type vagrant ssh -c "sudo systemctl restart thin". Or you can vagrant reload to restart the dev box.

Using MailCatcher (testing email)

See Using MailCatcher.

Vagrant Docs

For more help with Vagrant, check out the Vagrant docs.