With the different path that the PostgreSQL for Mac project uses, the Ruby Gem installation can be a little bit tricky if you don't know the missing magic parameter. Armed with a little knowledge, the process gets very easy. Just open Terminal and type the following command:
gem install postgres -- --with-pgsql-dir=/Library/PostgreSQL8