I just upgraded from OS X Lion to OS X Mountain Lion. My rails environment for the most part stayed in tact.
The only steps I had to do to get things back to a good
I had the exact same issue; same stack trace as you've posted.
MRI 1.9.3-p286 / OS X 10.8.2 / Postgres 9.0.4 with homebrew.
I solved it by simply doing:
$ brew update $ brew upgrade postgresql $ bundle
Hope it works for someone else.