【问题标题】:Error installing Ruby 1.9.3 using RVM使用 RVM 安装 Ruby 1.9.3 时出错
【发布时间】:2012-03-15 23:07:48
【问题描述】:

我正在尝试安装 Ruby 1.9.3。

我正在跑步:

  • Xcode 4.3.1
  • 我从 kennethreitz / osx-gcc-installer 安装了 GCC

错误

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

制作.log

[2012-03-16 06:59:48] make 
    CC = clang
    LD = ld
    LDSHARED = clang -dynamiclib
    CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration  -fno-common -pipe 
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I. -I.ext/include/x86_64-darwin11.3.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/zaikshev88/.rvm/rubies/ruby-1.9.3-p125/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,_Init_* -Wl,-unexported_symbol,*_threadptr_*  -Wl,-u,_objc_msgSend   
    SOLIBS = 
linking miniruby
<internal:prelude>:1: [BUG] Bus Error
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]

-- Control frame information -----------------------------------------------
c:0003 p:0002 s:0006 b:0006 l:000005 d:000005 TOP    <internal:prelude>:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0025d8 d:0025d8 TOP   

-- Ruby level backtrace information ----------------------------------------
<internal:prelude>:1:in `<compiled>'

-- C level backtrace information -------------------------------------------

   See Crash Report log file under ~/Library/Logs/CrashReporter or
   /Library/Logs/CrashReporter, for the more detail of.

-- Other runtime information -----------------------------------------------

* Loaded script: ./miniruby

* Loaded features:

    0 enumerator.so

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [.rbconfig.time] Abort trap: 6

【问题讨论】:

  • 请尝试 [my answer in the question 'Issue update Ruby on Mac with Xcode 4.3.1']Stack Overflow?我想知道结果。我想重点是用 rvm 安装 iconv。 Stack Overflow: stackoverflow.com/questions/9651670/… 最近,我使用上述步骤安装时没有这样的问题。我也试过 osx-gcc-installed 但它在我的情况下不起作用。

标签: ruby xcode osx-lion rvm


【解决方案1】:

Ruby 1.9.3 具有对基于 clang 的编译器的实验性支持,尽管随着新版本的发布,它变得越来越重要。 p125 应该已经解决了崩溃问题,但您不是第一个看到该故障的人。

相反,我建议您安装没有 LLVM 的 Apple GCC,例如 Macports apple-gcc-42 或 brew apple-gcc-42,然后使用它来编译 Ruby。 (这还有一个优点,它适用于 Ruby 1.9.2 及更早版本,以及第三方 gem,没有段错误。)

也可以使用osx-gcc-installer安装非LVM gcc-4.2,这里也适合使用。

【讨论】:

  • 你忘了提到 osx-gcc-installer
  • 我不相信osx-gcc-installer 实际上包含一个 GCC-without-LLVM; IIRC,它有 clang 和 gcc-llvm-42,这两个都不是完全支持的。 (Ruby 中的问题在于后端代码生成器,以及 LLVM 和 Ruby 假设之间的不兼容,而不是前端。)您可以通过运行 gcc --version 并检查它是否包含 LLVM 来检查。 i686-apple-darwin11-llvm-gcc-4.2 不适合这个目的。
  • osx-gcc-installer 包括 gcc-4.2 不包括 llvm,RVM 在 osx 上总是首选 gcc-4.2 而不是 gcc。您不必使用 macports 来安装它......它也是编译的整个堆栈(除了绑定到 OSX 本身),所以它也适用于自制软件。
猜你喜欢
  • 2012-07-23
  • 1970-01-01
  • 2023-04-04
  • 2013-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多