我如何获得“宝石安装”在带有Ruby 1.8.7的OS X Lion上工作而不会出现段错误? [英] How do I get "gem install" to work on OS X Lion with Ruby 1.8.7 without seg faulting?
问题描述
我是Rails的新手/终端用户,之后刚进行了Lion的全新安装+ Xcode。
I am novice rails/terminal user and just did a fresh Lion install + Xcode after that.
已安装RVM,但是当我执行 gem install [any gem]在终端中,我收到此错误:
Installed RVM but when I execute "gem install [any gem]" in terminal, I get this error:
/Users/[my user]/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.0.0]
Abort trap: 6
有人可以帮忙吗?
PS。我正在使用-在正在进行的项目中,我必须使用ruby v1.8.7。
PS. I am using - and in the project I am working on, I must use ruby v1.8.7.
推荐答案
请确保您的rvm是最新的: rvm获取最新
Make sure your rvm is up to date: rvm get latest
然后运行此命令: rvm uninstall 1.8 .7&& CC = / usr / bin / gcc-4.2 rvm install 1.8.7
基本上,您必须告诉rvm使用哪个gcc编译器( CC = / usr / bin / gcc-4.2
)
Basically you must tell rvm which gcc compiler to use (CC=/usr/bin/gcc-4.2
)
然后,您应该能够正常安装pg gem。
Then you should be able to install the pg gem as normal.
这篇关于我如何获得“宝石安装”在带有Ruby 1.8.7的OS X Lion上工作而不会出现段错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!