3

I am trying to install Ruby 1.9.3.

I am running:

  • Xcode 4.3.1
  • I installed GCC from kennethreitz / osx-gcc-installer

Error

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.

Make.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
meow
  • 27,476
  • 33
  • 116
  • 177
  • Please try the steps in [my answer in the question 'Issue updating Ruby on Mac with Xcode 4.3.1'][SO]? I want to know the result. I guess the important point is installing iconv with rvm. [SO]: http://stackoverflow.com/questions/9651670/issue-updating-ruby-on-mac-with-xcode-4-3-1/9651747#9651747 Lately, I don't have issues like this when I use above steps to install. I also tried osx-gcc-installed but it does not work in my case. – shigeya Mar 25 '12 at 06:02

1 Answers1

1

Ruby 1.9.3 has experimental support for clang based compilers, although it is getting more serious as newer versions are released. p125 is supposed to have addressed the crashes, but you are not the first person to see that failure.

Instead, I recommend that you install an Apple GCC-without-LLVM such as the Macports apple-gcc-42 or brew apple-gcc-42, then use that to compile Ruby. (This also has the advantage that it works for Ruby 1.9.2 and earlier, and for third party gems, without segfaults.)

You can also use osx-gcc-installer to install a non-LVM gcc-4.2, which is also suitable for use here.

Daniel Pittman
  • 16,733
  • 4
  • 41
  • 34
  • you forgot to mention osx-gcc-installer – mpapis Mar 16 '12 at 00:02
  • I don't believe that `osx-gcc-installer` actually includes a GCC-without-LLVM; IIRC, it has clang and gcc-llvm-42, neither of which are fully supported. (The issues in Ruby are around the back-end code generator, and incompatibilities between LLVM and Ruby assumptions, not around the front-end.) You can check by running `gcc --version` and checking if it includes LLVM at all. `i686-apple-darwin11-llvm-gcc-4.2` is not good for this purpose. – Daniel Pittman Mar 16 '12 at 00:07
  • osx-gcc-installer includes `gcc-4.2` which does not include llvm, RVM always preferred `gcc-4.2` over `gcc` on osx. You do not have to use macports to install it ... it also is the whole stack to work with compilation (except bindings to OSX itself), so it is suitable for homebrew too. – mpapis Mar 16 '12 at 03:02