Skip to content

Common Tasks

Mark Bussey edited this page Apr 24, 2018 · 16 revisions
  • Start the VM if it's not running

    1. Open a new terminal window
    2. Change directory to the directory with Vagrantfile in it
    3. Type vagrant up
  • Connect to the VM

    1. From the directory with Vagrantfile in it, type
      vagrant ssh
    2. For the tutorials here, you'll always want to run from the same directory. Change your working directory:
      cd /vagrant/ohsu2018
  • Start Solr, Fedora, and web servers hydra:server

    1. Open a separate terminal and connect to a new ssh session where you can leave the servers running (see the steps above)
    2. Type cd /vagrant/ohsu2018 to change directory to the root of your Rails application
    3. Type rails hydra:server to start Solr, Fedora, and the Web server
  • Start Solr, Fedora servers for you test environment hydra:test_server

    1. Open a separate terminal and connect to a new ssh session where you can leave the servers running (see the steps above)
    2. Type cd /vagrant/ohsu2018 to change directory to the root of your Rails application
    3. Type rails hydra:test_server to start Solr, Fedora, and the Web server

    ALTERNATE Instead of leaving

  • Editing files

    1. This tutorial assumes that you run the examples within your virtual machine from the /vagrant/ohsu2018 directory
    2. The entire /vagrant directory in your virtual machine (guest) is shared to your laptop (host), so you can use your favorite editor or IDE to edit files easily at path-you-copied-to-on-your-host-system/vagrant/ohsu2018
    3. Inside the guest machine, you can also use common Linux editors like vim and nano to edit files.
  • Start a Rails console

    1. Make sure you're connected to the VM
    2. Type cd /vagrant/ohsu2018 to change directory to the root of your Rails application
    3. Type rails console to enter the console (or rails c for shorthand)
    4. Type exit when you're done to return to the command line
  • Fix Solr if you get an error like ERROR: Core 'hydra-test' already exists!

    1. Clear the test solr instance using rm -rf tmp/solr-development/server/solr/hydra-test
    2. Try rails ci again and things should work; if not, ask for help!
  • Wipe out everything and start over

    1. On your host system, open a terminal window and switch to your vagrant directory cd [path-on-your-local-system]/vagrant
    2. Kill the Vagrant virtual machine vagrant destroy - answer 'y' when prompted
    3. OPTIONAL WITH FIRE Remove the base virtual machine vagrant box remove --all camper
    4. Follow the Initial Vagrant Setup instructions again