There are variations of this question bouncing around SO, but none of them seem to have an answer that solves my problem.
I am running OSX Lion (10.7.3). The latest
On OS X Mavericks
sudo ln -s /usr/bin/llvm-gcc /usr/bin/gcc-4.2
works.
I also ran into this issue, for me the answer was updating RVM of all things.
rvm get head
rvm install 1.9.2
I am on Mountain Lion, and the accepted answer from Dave Isaacs worked for me. I also had to do
sudo ln -s llvm-g++-4.2 g++-4.2
After a Mavericks upgrade...
Reinstall your ruby version.
rvm uninstall 1.9.2-p320
then
rvm install 1.9.2-p320
or whatever version of ruby you have.
I too, am on Mountain Lion, besides the "sudo ln -s /usr/bin/{llvm-,}gcc-4.2" suggested by @grilix, I needed to do:
sudo ln -s /usr/bin/{llvm-,}g++-4.2
$ gem install pg
If that failed:
$ sudo gem install pg
Then, if that failed:
$ sudo find / -name “pg_config”
After you find pg_config
's location, run this to finally install it:
$ sudo gem install pg --with-pg-config=/usr/local/Cellar/postgresql/9.5.1/bin/pg_config
Of course, you'll want to change the path to wherever you found pg_config
.
Then, check your installed gems with gem list
, and it should show something like this:
More information can be found in my guide.