【问题标题】:Can't install Ruby on Mountain Lion 10.8.2无法在 Mountain Lion 10.8.2 上安装 Ruby
【发布时间】:2012-11-29 02:52:46
【问题描述】:

我在我的 Mac 和 Xcode 4.5.2 上运行 Mountain Lion v. 10.8.2

我运行的 ruby​​ 版本是默认版本 1.8.7。我想升级到 1.9.3 但它不起作用。

我安装了 gcc 编译器:

$ gcc --version 

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ git --version
git version 1.7.8

$ rvm --version
rvm 1.17.0 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

然后我尝试使用以下命令行安装 Ruby 1.9.3:

$ rvm install 1.9.3

输出是这样的:

No binary rubies available for: downloads/ruby-1.9.3-p327.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /Users/eduardo/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...

ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...

ruby-1.9.3-p327 - #extracted to /Users/eduardo/.rvm/src/ruby-1.9.3-p327 (already extracted)

ruby-1.9.3-p327 - #configuring

ruby-1.9.3-p327 - #compiling

Error running 'make', please read /Users/eduardo/.rvm/log/ruby-1.9.3-p327/make.log
There has been an error while running make. Halting the installation.

我的 make.log 在最后几行看起来像这样:

collect2: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-darwin12.2.0/tcltklib.bundle] Error 1
make[1]: *** [ext/tk/all] Error 2
make: *** [build-ext] Error 2

请问有什么帮助吗?我不知道如何解决这个问题。

【问题讨论】:

  • 尝试在没有 tk 的情况下安装 Ruby:rvm install 1.9.3 --without-tk
  • 尝试卸载 XCode 并使用 OS X gcc 安装程序:github.com/kennethreitz/osx-gcc-installer 当我这样做时,我取得了巨大的成功。如果你需要 XCode——比如说,开发 iOS 应用——在安装你的 rubies 之后重新安装它。
  • 酷...“rvm install 1.9.3 --without-tk”工作了!!!!谢谢

标签: ruby xcode macos


【解决方案1】:

我今天拿到了我的 macbook pro,并使用本教程安装了 ruby​​:https://gist.github.com/3237860

【讨论】:

  • 伟大的纲要,非常简洁!
  • 你能加入-chat吗?
猜你喜欢
  • 2013-03-21
  • 1970-01-01
  • 2012-12-12
  • 2013-02-10
  • 2012-10-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多