为什么我不能使用RVM在Lion上安装Rails? [英] Why can't I install Rails on Lion using RVM?
问题描述
尝试使用RVM在OS X Lion上安装Rails时遇到了问题.
I'm running into issues trying to install Rails on OS X Lion using RVM.
到目前为止,我已经执行了以下操作:
So far, I have done the following:
- 已安装Mac OS X Lion版本10.7(内部版本11A459e).
- 已安装XCode 4.1 Developer Preview 5.
- 已安装的RVM.
- 使用命令
rvm install 1.8.7
通过RVM安装了1.8.7版本的Ruby.注意:我需要使用1.8.7而不是1.9.2. - 使用命令
rvm 1.8.7
切换到Ruby 1.8.7版本. - 使用命令
rvm gemset create rails3
创建了一个新的宝石集. - 使用命令
rvm use 1.8.7@rails3
切换到新的宝石集. -
要安装Rails,我运行了命令
gem install rails
,但出现以下错误:
- Installed Mac OS X Lion Version 10.7 (Build 11A459e).
- Installed XCode 4.1 Developer Preview 5.
- Installed RVM.
- Installed a 1.8.7 version of Ruby via RVM using the command
rvm install 1.8.7
. Note: I need to be using 1.8.7 and not 1.9.2. - Switched to the 1.8.7 version of Ruby using the command
rvm 1.8.7
. - Created a new gemset using the command
rvm gemset create rails3
. - Switched to the new gemset using the command
rvm use 1.8.7@rails3
. To install Rails I ran the command
gem install rails
but I got the following error:
/Users/m/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:60:[BUG]细分错误
/Users/m/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
尝试运行任何gem命令时也会发生相同的错误,因此我认为Rails并不是真正的问题.
The same error happens when trying to run any gem command so I don't think it's really a problem with Rails.
从下面的链接来看,我似乎并不是唯一一个遇到此问题的人:
Judging by the links below, I don't seem to be the only person having this issue:
http://twitter.com/#!/pingles/status/66261101351927809 和 https://github.com/carlhuda/bundler/issues/1058
推荐答案
已修复!
答案实际上是在我上面发布的链接之一上.在安装一个版本的ruby(rvm安装1.8.7)之前,我需要运行"export CC=/usr/bin/gcc-4.2
".有了这个,一切都可以顺利进行.
The answer was actually on one of the links I posted above. Before installing a version of ruby (rvm install 1.8.7) I needed to run "export CC=/usr/bin/gcc-4.2
". With that in place, everything ran smoothly.
如果您不想永久导出CC
,则可以执行CC=/usr/bin/gcc-4.2 rvm install 1.8.7
If you don't want to have CC
permanently exported, you can do CC=/usr/bin/gcc-4.2 rvm install 1.8.7
如果您已经安装了ruby 1.8.7.只要做CC=/usr/bin/gcc-4.2 rvm reinstall 1.8.7
If you have already installed ruby 1.8.7. Just do CC=/usr/bin/gcc-4.2 rvm reinstall 1.8.7
这篇关于为什么我不能使用RVM在Lion上安装Rails?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!