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
Fro those, who are using Kubuntu 13.04 and installed pg with one click tool, pg config is in other folder, so command:
gem install pg -- --with-pg-config=/opt/PostgreSQL/9.3/bin/pg_config