I'm not quite sure why you're installing the pg gem if you're not using PostgreSQL, but anyway:
You may have to specify your CPU architecture. First, run the following to see which architecture you're running on:
(Note: Replace '/usr/bin/ruby' with whatever 'which ruby' returns).
$ lipo -detailed_info /usr/bin/ruby
In there, you should see something about your architecture (look for 'i386' or 'x86_64')
If that doesn't work, try the following:
$ irb
['foo'].pack('p').size
The result will be '8' if Ruby is running as 64-bit, or '4' if it's running in 32-bit.
Then, when you go to install the Postgres gem, specify the appropriate architecture:
$ sudo env ARCHFLAGS="-arch i386" gem install pg
Or,
$ sudo env ARCHFLAGS="-arch x86_64" gem install pg
If you're running Snow Leopard with a 64-bit CPU, then you're probably running the 64-bit version. But still double-check your architecture.