Friday, March 12, 2010

Ubuntu Karmic 9.10 and ruby-pg

PostgreSQL, Ubuntu, and Rails seem exactly like a winning combination for the type of work I do.

As of this writing (March 12, 2010), the best driver to connect Rails and PostgreSQL is easily ruby-pg. My development environment is Snow Leopard, and my troubles installing ruby-pg on OS X were alleviated by this very helpful article at icoretech.

My server environment of choice is Ubuntu. Getting things up and running had me stumbling a bit again with the ruby-pg gem driver. Turns out the solution is simple -- just install the postgresql-server-dev-8.4 package and the gem installs fine.

The following steps will have PostgreSQL 8.4 and the ruby-pg driver up and running on your Ubuntu Karmic system (assuming you've already installed Ruby)

sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-8.4
sudo gem install pg

No comments:

Post a Comment