How do I get “gem install” to work on OS X Lion with Ruby 1.8.7 without seg faulting?

南笙酒味 提交于 2019-11-28 20:53:44

Make sure your rvm is up to date: rvm get latest

And then run this: rvm uninstall 1.8.7 && CC=/usr/bin/gcc-4.2 rvm install 1.8.7

Basically you must tell rvm which gcc compiler to use (CC=/usr/bin/gcc-4.2)

Then you should be able to install the pg gem as normal.

uninstall it with

rvm remove 1.8.7

then do the

CC=/usr/bin/gcc-4.2 rvm install 1.8.7
rc1021

In Mac OSX Lion (10.7), gcc-4.2 is not installed.

So you must download the installer (https://github.com/kennethreitz/osx-gcc-installer) and install it, then run

rvm uninstall 1.8.7 && CC=/usr/bin/gcc-4.2 rvm install 1.8.7
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!