Skip to content

Building and Running

jdee edited this page Oct 30, 2010 · 24 revisions

Prerequisites

The following instructions are for a vanilla Ubuntu 10.04 installation except where otherwise noted.

System packages

sudo apt-get install gcc libreadline6-dev libzlib-ruby zlib1g-dev

PostgreSQL

Ubuntu:

sudo apt-get install postgresql-8.4 libpq-dev

OS X: (MacPorts)

You cannot build the pg gem againt a precompiled PostgreSQL installation. MacPorts builds it locally from source and installs it for you:

sudo port install postgresql84
sudo port install postgresql84-server

Follow the instructions at the end to initialize a default database.

All:

Once PostgreSQL is installed and running:

sudo -u postgres createuser $LOGNAME

Make the new user (yourself) a superuser. Edit the user name and password (if any) in config/database.yml to agree with the PostgreSQL user you just created.

RVM

RVM is strongly recommended. Click here for a brief tutorial.

Bundler

Install the bundler gem.

gem install bundler

Dubsar

Install gems with the bundler.

bundle install

Set up the database.

rake db:create
rake db:schema:load

Seed the database.

rake db:seed
(in /home/jdee/github/jdee/dubsar)
2010-10-17 06:15:45 -0500 loading adjectives
2010-10-17 06:29:47 -0500 loaded 21601 adjectives (18156 synsets)
2010-10-17 06:29:47 -0500 loading adverbs
2010-10-17 06:32:43 -0500 loaded 4477 adverbs (3621 synsets)
2010-10-17 06:32:43 -0500 loading nouns
2010-10-17 07:55:18 -0500 loaded 118532 nouns (82115 synsets)
2010-10-17 07:55:18 -0500 loading verbs
2010-10-17 08:09:15 -0500 loaded 11308 verbs (13767 synsets)

Note: Seeding the DB takes an hour or two on a decent 64-bit processor. While you’re waiting, you can run the unit tests and generate local documentation.

Run unit tests.

rake test

Generate local HTML documentation in doc/app/index.html:

rake doc:app

Once the database has been seeded, run the server.

rails server

Connect a browser to port 3000.

Clone this wiki locally