Skip to content

Notes on the build process

savetheclocktower edited this page Sep 13, 2010 · 1 revision

In addition to the steps outlined in the README, I had to perform some extra tasks in order to get things up and running. Some of these are specific to my platform (Mac OS X 10.5).

PostgreSQL

I compiled PostgreSQL from source, but ran into a weird issue when calling initdb for the first time. Turns out OS X (Leopard) doesn’t allocate enough shared memory. After much googling, I fixed it by creating /etc/sysctl.conf (it won’t exist already) with these lines:

kern.sysv.shmmax=524288000
kern.sysv.shmmin=1
kern.sysv.shmmni=64
kern.sysv.shmseg=16
kern.sysv.semmns=130
kern.sysv.shmall=131072000
kern.sysv.maxproc=2048
kern.maxprocperuid=512

After a reboot, everything worked fine.

Gems

There are several gem dependencies that aren’t mentioned in the README. Nearly all can be addressed with rake gems:install.

ImageMagick and RMagick

If you don’t have ImageMagick and RMagick installed already, you’ll need to suffer through that installation process. The easiest route for me was to download the RMagick OS X Installer and run ruby rm_install.rb from the Terminal. The script completed all steps for me except the last one — it bailed on the installation of RMagick itself for a reason I couldn’t figure out. But it had installed all of RMagick’s dependencies, so a quick sudo gem install rmagick finished up the process.

htree

The app requires the htree parsing library — which doesn’t exist in gem form, for some stupid reason. Download it from the htree site and install it with ruby install.rb.

Fix some hard-coded references in the source

The GOVTRACK_DATA_PATH and GOVTRACK_BILLTEXT_PATH constants in config/environments/development.rb need to be changed to wherever you decide to store the GovTrack data.

Fix a WHOLE BUNCH of stuff in the migrations

The migrations are sloppy. In one, you’ll have to remove a bunch of SQL that was copied out of the `tsearch2.sql` file (because you’ll already have executed this SQL as part of the earlier setup). My version of PostgreSQL didn’t like the VACUUM statements inside of migrations, so I commented them out. I also commented out anything that had to do with Solr, because I didn’t bother installing that beforehand. (Of course, this leaves some pages on the site inaccessible.)