为什么我不能使用RVM在Lion上安装Rails? [英] Why can't I install Rails on Lion using RVM?

查看:65
本文介绍了为什么我不能使用RVM在Lion上安装Rails?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用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:

  1. 已安装Mac OS X Lion版本10.7(内部版本11A459e).
  2. 已安装XCode 4.1 Developer Preview 5.
  3. 已安装的RVM.
  4. 使用命令rvm install 1.8.7通过RVM安装了1.8.7版本的Ruby.注意:我需要使用1.8.7而不是1.9.2.
  5. 使用命令rvm 1.8.7切换到Ruby 1.8.7版本.
  6. 使用命令rvm gemset create rails3创建了一个新的宝石集.
  7. 使用命令rvm use 1.8.7@rails3切换到新的宝石集.
  8. 要安装Rails,我运行了命令gem install rails,但出现以下错误:

  1. Installed Mac OS X Lion Version 10.7 (Build 11A459e).
  2. Installed XCode 4.1 Developer Preview 5.
  3. Installed RVM.
  4. 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.
  5. Switched to the 1.8.7 version of Ruby using the command rvm 1.8.7.
  6. Created a new gemset using the command rvm gemset create rails3.
  7. Switched to the new gemset using the command rvm use 1.8.7@rails3.
  8. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆