为什么我不能使用 RVM 在 Lion 上安装 Rails?

编程入门 行业动态 更新时间:2024-10-23 14:27:46
本文介绍了为什么我不能使用 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:

  • 已安装 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 切换到 1.8.7 版本的 Ruby.
  • 使用命令 rvm gemset create rails3 创建了一个新的 gemset.
  • 使用命令 rvm use 1.8.7@rails3 切换到新的 gemset.
  • 要安装 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:

    twitter/#!/pingles/status/66261101351927809和 github/carlhuda/bundler/issues/1058

    推荐答案

    已修复!

    答案实际上是在我上面发布的链接之一上.在安装 ruby​​ 版本(rvm install 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 重新安装 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?

    本文发布于:2023-10-31 04:58:05,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1545069.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:我不   RVM   Rails   Lion

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!