Skip to content

Installation from Ubuntu Image

Sam Joseph edited this page Mar 12, 2014 · 7 revisions
  1. [Install](Installation from Ubuntu Image#install)
  • [Prepare the VM](Installation from Ubuntu Image#prepare-the-vm)
  • [Setup the LocalSupport development environment](Installation from Ubuntu Image#setup-the-localsupport-development-environment)
  1. [Run locally](Installation from Ubuntu Image#run-locally)
  2. [Run tests](Installation from Ubuntu Image#run-tests)

Install

The following procedure can be used to install the LocalSupport development environment from a clean version of Ubuntu 12.04LTS. Make sure your computer has a good connection to the Internet throughout the installation as many packages are downloaded throughout the install procedure.

Prepare the VM

  1. Download the 32-bit Ubuntu 12.04 image from:
  1. Download and install the appropriate version of Oracle’s VirtualBox for your system (your system is the “host.”):
  1. Open VirtualBox and create a new virtual machine using Ubuntu 12.04:
  • Click “New” to create a new machine
  • Name: “LocalSupport”; Type: Linux; Version: Ubuntu
  • Memory Size: Allocate a minimum of 1024MB. If you plan to use RubyMine, 2GB or more are recommended. (But remember that memory allocated to the virtual machine will not be available to your host computer while the VM is running.)
  • Create a Virtual Hard Drive
  • Choose VDI (Virtual Disk Image)
  • Choose Dynamically Allocated
  • Choose the hard disk space you want to allocate (20GB is good. More is better, especially if you might use this VM for other projects.)
  1. Now that the LocalSupport Virtual Machine (VM) is created, install Ubuntu 12.04.3 LTS (precise Pangolin):
  • Click on and start the LocalSupport VM
  • When prompted to choose a hard drive, browse to and select the Ubuntu iso file (downloaded previously)
  • When you reach the Welcome window - choose “Install Ubuntu”
  • Select “Erase Disk and Install Ubuntu” (Don’t worry - it’s only erasing and installing your virtual machine, not your regular hard drive!)
  • Click “Install now” and follow instructions.
  • Install with updates and 3rd party options
  • Get a coffee or a sandwich while you wait...
  1. Once on the Ubuntu desktop, add Terminal and Gedit icons.
  • optionally: Set Gedit as default editor with "sudo update-alternatives --config editor"
  • optionally: Remove OpenOffice and Ubuntu One icons from launcher and add Terminal and Gedit icons.
  1. Change terminal to run command as a login shell so that it would run the bash_profile and RVM and rails would work properly:
  • Menu > Edit > Profile Preferences > Title and Command. (The menu in Ubuntu is located at the very top of the screen. Mouse over the top bar to make the menu appear)
  • Check the box next to: Run command as a login shell
  1. Install VirtualBox Guest Additions:
  • VirtualBox menu > Devices > Insert Guest Additions CD image...
  • Follow the prompts
  1. Reboot the VM.

Setup the LocalSupport development environment

  1. To download and run the initial setup script for your VM

  2. Open a Terminal window and execute:

wget -q https://raw.github.com/AgileVentures/LocalSupport/develop/clean-ubuntu-install-1.sh
  1. Give the file execute permissions:
chmod u+x clean-ubuntu-install-1.sh
  1. Run the script:
./clean-ubuntu-install-1.sh

Get another coffee... Note: This process takes several minutes (approx. 10-45 minutes) and requires that you provide the password multiple times.

  1. Close all terminal windows and open a new terminal session.
  2. Fork the http://github.com/AgileVentures/LocalSupport repo (fork button at top right of github web interface)
  3. Clone your new forked repo onto your VM. Run the following from a terminal window:
git clone https://github.com/<yourname>/LocalSupport.git
  1. A new LocalSupport folder will be created. cd into LocalSupport:
cd LocalSupport
  1. Download and run the app install script:

  2. Download with wget:

wget -q https://raw.github.com/AgileVentures/LocalSupport/develop/clean-ubuntu-install-2.sh
  1. Change permissions
chmod u+x clean-ubuntu-install-2.sh
  1. Run the script
./clean-ubuntu-install-2.sh

Note: This process takes another several minutes (approx. 10-45 minutes) and requires that you provide the password multiple times. With this much coffee in your system, this will test your patience, you've been warned!

  1. You can now delete the downloaded shell scripts
rm clean-ubuntu-install-2.sh
rm ../clean-ubuntu-install-1.sh

Optional:

  1. Add Web Developer Addon to firefox from https://addons.mozilla.org/en-US/firefox/addon/web-developer/
  2. Add Chromium icon to Launcher
  3. Run Ubuntu updates

If you hit problems, ask us on Skype.

Run locally

In principle, you can run rails server and see that app running locally.

rails s

The db/seeds.rb task that the app install script ran added some organizations and a local admin user that you can experiment with. Read that file for more information.

Run tests

Also you should run the specs and cucumber features to make sure your installation is solid. The test database was prepared in the app install script. Run tests using following commands:

bundle exec rake spec
bundle exec rake cucumber

and then when you start any BDD or TDD ensure autotest is running in the background:

bundle exec rake autotest