Skip to content

Latest commit

 

History

History
96 lines (57 loc) · 3 KB

README.md

File metadata and controls

96 lines (57 loc) · 3 KB

OpenCongress - a Ruby on Rails application for displaying information about Congress


## Getting started with our code

A. Dependencies

Start by installing all the packages required by OpenCongress.

For Ubuntu:

sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev ruby1.8 ruby1.8-dev rubygems libopenssl-ruby imagemagick libmagick9-dev gcj-4.4-jre

or Mac OS X, start by installing MacPorts, then run:

sudo port install postgresql84 postgresql84-doc postgresql84-server ImageMagick md5sha1sum wget

Follow the instructions from the port install for initializing your database


Then grab the gems you need:


sudo gem install rails bluecloth mediacloth hpricot htree jammit json pg RedCloth ruby-openid simple-rss rmagick htmlentities oauth

Note for OS X: You may need to specify additional compile options for the pg gem. Make sure pg_config is in PATH and run sudo env ARCHFLAGS="-arch x86_64" gem install pg

B. Database setup

Switch to the postgres user and setup a db user following prompts for password and superuser.

sudo su postgres
createuser opencongress -P

Create your database

createdb opencongress_development -O opencongress

Import the tsearch2 backwards compatibility lib from wherever your postgres contribs got installed.

psql opencongress_development < /your/install/share/postgresql/contrib/8.4/tsearch2.sql

exit postgres user

C. App Setup

Copy over example yml files in /config

cd config; for file in `ls *example*`; do cp $file `expr "$file" : '\([^-\.]*\)'`.yml; done

Edit database.yml:

development:
adapter: postgresql
database: opencongress_development
username: opencongress
password: (password from step B)
host: localhost

Now you can start the solr server and run the database migrations

cd ..;rake solr:start
rake db:structure:load
rake db:seed

D. Data

create some dirs for data

Make sure all your data paths are set and exist in your environment file then run rake update:all to fetch and parse all available data sources. This process will take a very long time. Take a look at /lib/tasks/daily.rake for all the rake tasks if you want to run them individually.

Now just a script/server and you should be running


Copyright (c) 2005-2010 Participatory Politics Foundation

OpenCongress is licensed, as a whole, under AGPLv3. Components added prior to OpenCongress version 3 (July 27, 2011) were and are licensed under GPLv3. All components added for or after OpenCongress version 3 are licensed AGPLv3. When you contribute a patch to OpenCongress, it will be licensed under AGPLv3. See LICENSE-AGPLv3 file for details.