Initial Vagrant Setup - RepoCamp/ohsu2018 GitHub Wiki

This guide walks you through the steps to set a VM with all the necessary Hyrax prerequisites so that you can get going quickly with the tutorials in this WIKI. The application was built following the main outline of the instructions on the Hyrax github page, and we have added the steps to make using a Vagrant based virtual machine easier and to minimize the number of downloads you'll need to do while in class.

Goals:

  • Start a vagrant based virtual machine
  • Log into the VM
  • Confirm the versions of software installed

Prerequisites

  • At least 4GB of available RAM in your host system
  • A Recent version of VirtualBox Installed
  • A Recent version of Vagrant Installed
  • Windows Users only - we recommend you install GitHub Desktop app which provides a number of useful tools

Set up the VM from a thumb-drive

  • Install Vagrant & VirtualBox if you haven’t already (use the installers on the thumbdrive to save WIFI bandwidth)
  • Copy the /tutorial folder from the thumbdrive to your laptop
  • Open a terminal window and change to the tutorial/vagrant directory
  • Start the VM by typing
    vagrant up

[ALTERNATE] Set up the VM from the web

  • Install Vagrant & VirtualBox if you haven’t already
  • Open a terminal window and create a directory named vagrant
    mkdir vagrant
  • Change your working directory to the new directory
    cd vagrant
  • Get a copy of the Vagrantfile configured specifically for the tutorials
    wget http://camp.curationexperts.com/Vagrantfile
  • Start the VM by typing
    vagrant up

Connect to the VM

  • Verify that you have the correct version of the VM running
    vagrant box list

    This should show camper (virtualbox, 6.1). If you don't see this version listed, try vagrant destroy && vagrant box remove camper --all, then run vagrant up again.

  • Connect to the VM by typing
    vagrant ssh

    Ask for help if you don’t end up with a prompt like vagrant@camper:~$ ← when you see this, you’re ready for the tutorial exercises.

Check the installed versions

  • From the vagrant@camper:~$ prompt in your VM, check the installed versions by typing each of the following commands:
    • Ruby: ruby --version --> 2.4.2p198
    • Rails: rails --version --> 5.1.6
    • RVM: rvm --version --> 1.29.3

If you don't see these versions, go back and check you completed each step above. If you're in class, don't hesitate to ask for help.

Add your git identity in the VM

  • From the vagrant@camper:~$ prompt in your VM, set your git identity
    • Add your git display name
      git config --global user.name "Camper, Happy"
    • Add the e-mail associated with your GitHub account
      git config --global user.email "[email protected]"