Skip to content

Building and Running

Jimmy Dee edited this page Nov 9, 2010 · 24 revisions

Prerequisites

System packages

PostgreSQL

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

Note: You should not use sudo with the gem install command if you are using RVM.

Dubsar

Install gems with the bundler.

bundle install

Re-seeding vs. migrations

The WordNet® data set used by Dubsar is quite static, so there is little point in migrating the data. In some cases, it may be desirable to add a small migration (to add an index, for example). However, when making a major update to the database (each time the data model expands), it makes more sense to re-seed from scratch each time. If you pull and migrate, but find that things aren’t working after a significant change to the database, your best bet is to re-seed from scratch:

rake db:drop
rake db:setup

Note rake db:setup is simply a shortcut for:

rake db:create
rake db:schema:load
rake db:seed

Seeding the database

Set up the database.

rake db:create
rake db:schema:load

Seed the database.

jdee@fatman:models$ rake db:seed
(in /home/jdee/github/jdee/dubsar)
Tue Nov 09 11:26:51 +0000 2010 loaded verb frames
Tue Nov 09 11:26:51 +0000 2010 loaded lexical names
Tue Nov 09 11:26:53 +0000 2010 loaded sense index
Tue Nov 09 11:26:53 +0000 2010 loaded irregular adjective inflections
Tue Nov 09 11:26:53 +0000 2010 loading adjectives
Tue Nov 09 11:34:48 +0000 2010 loaded 21844 adjectives (18156 synsets, 30004 senses)
Tue Nov 09 11:34:48 +0000 2010 loaded irregular adverb inflections
Tue Nov 09 11:34:48 +0000 2010 loading adverbs
Tue Nov 09 11:36:16 +0000 2010 loaded 4481 adverbs (3621 synsets, 5580 senses)
Tue Nov 09 11:36:16 +0000 2010 loaded irregular noun inflections
Tue Nov 09 11:36:16 +0000 2010 loading nouns
Tue Nov 09 12:14:29 +0000 2010 loaded 119034 nouns (82115 synsets, 146347 senses)
Tue Nov 09 12:14:29 +0000 2010 loaded irregular verb inflections
Tue Nov 09 12:14:29 +0000 2010 loading verbs
Tue Nov 09 12:24:02 +0000 2010 loaded 11531 verbs (13767 synsets, 25047 senses)
Tue Nov 09 12:24:02 +0000 2010 loading adjective pointers
Tue Nov 09 12:33:29 +0000 2010 loading adverb pointers
Tue Nov 09 12:34:05 +0000 2010 loading noun pointers
Tue Nov 09 13:35:48 +0000 2010 loading verb pointers
Tue Nov 09 13:47:11 +0000 2010 ### Dubsar DB seed complete ###

Note: Seeding the DB takes a number of hours 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