The main dependencies are Ruby 1.9.x, the ZeroMQ library and the bundler gem. Once the bundler gem is installed, bundler can be used to install the remaining dependencies using the Gemfile in the root directory of the project. You may want to install and use a RVM gemset. This keeps to the installed gems separated from other gems on your system to prevent any version conflicts.
The system has not been tested on Windows, we strongly recommend using Linux or Mac OS X (if you have the developer tools installed.
-
Boot the lab machine in Linux
-
Clone the repository:
$ git clone git://github.com/ais-case/ais.git
-
Run the installer:
$ ais/installer.sh
-
Now in a new terminal window, go to the ais directory.
When asked:
Do you wish to trust this .rvmrc file?
,answer withyes
,<ENTER>
You can now jump straight to “Running the system” to start the services
The easiest way to run the system on your own laptop is by installing VirtualBox and using the (bootable) disk image from here. We recommend creating a VM with >1GB of memory.
If you run Linux or Mac OS X you may also use the other installation methods, but you may have to install additional packages.
RVM allows you to install and run the project without conflicts with other Ruby-based projects you might have installed. Instructions for the installation can be found at the RVM website. A quick overview of RVM installation and setup for this project:
-
Download and install RVM:
$ curl -L get.rvm.io | bash -s stable
-
Load RVM into current session:
$ source ~/.rvm/scripts/rvm
-
Download and install Ruby 1.9:
$ rvm install 1.9.3
-
Indicate you want to use Ruby 1.9.3:
$ rvm use 1.9.3
-
Create a separated gemset for this project:
$ rvm gemset create ais
-
Switch to the newly created environment:
$ rvm use "1.9.3@ais"
Before you work with the project you will always have to switch to this gemset. This can be automated by updating environment_id
in a .rvmrc
file of the project with the information about your environment. An example file is included as .rvmrc.distrib
The Ruby dependencies of the project are documented in the Gemfile. To install all dependencies, use the bundler gem:
-
Install bundler:
$ gem install bundler
-
Then from inside the project directory run bundler to download and install all dependencies:
$ bundle install
In addition to these Ruby Gems you will also need to install the ZeroMQ library available from www.zeromq.org.
From the main project folder you can start the service platform:
$ rake services:start
The process will run indefinitely, keeping the service processes alive in the background until you kill the rake task with CTRL-C
. To launch the web interface run the Rails webserver:
$ rails s
You should now be able to access the web interface from localhost:3000.
Note that sources of raw AIS messages are currently hardcoded in lib/services/transmitter_service.rb
.
There are three separate test suites, using a variety of tools. These tools are automatically installed when you run bundle install
.
-
Acceptance tests use the Cucumber tool, and are driven by browser automation with Capybara. Browser automation requires Firefox to be installed. The tests are defined in the
features
subdirectory. Run the acceptance tests with:$ rake cucumber
One note: acceptance tests have additional requirements, which are not installed when the installation method described in Quickstart is used. To install the additional dependencies run
bundle install
from the root of the project. -
Ruby unit tests use the RSpec tool, and can be found in the
spec
subdirectory. Run the unit tests with:$ rake spec
-
Javascript unit tests use the Jasmine tool, and can be found in
spec/javascript
. To run the tests use:$ rake jasmine:ci