Skip to content

Initial Vagrant Setup

Mark Bussey edited this page Apr 22, 2018 · 20 revisions

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

  • Recent version of VirtualBox Installed
  • Recent version of Vagrant Installed
  • A Vagrantfile which loads a VM preloaded with the Hyrax perquisites

Set up the VM from a Thumbdrive

  • 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.0.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.3.4p301
    • 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 "snacks@curationexperts.com"