7

我今天尝试使用 RVM 安装 Ruby 2,但失败了。我更新了 RVM,我所有的 brew 公式等等。这就是我得到的:

admin:/$ rvm install ruby-2.0.0-p0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-2.0.0-p0.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Already up-to-date.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Installing Ruby from source to: /Users/admin/.rvm/rubies/ruby-2.0.0-p0, this may take a while depending on your cpu(s)...
ruby-2.0.0-p0 - #downloading ruby-2.0.0-p0, this may take a while depending on your connection...
ruby-2.0.0-p0 - #extracting ruby-2.0.0-p0 to /Users/admin/.rvm/src/ruby-2.0.0-p0
ruby-2.0.0-p0 - #extracted to /Users/admin/.rvm/src/ruby-2.0.0-p0
ruby-2.0.0-p0 - #configuring......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
ruby-2.0.0-p0 - #compiling...............................................................................................................................................................................................................
Error running 'make -j8',
please read /Users/admin/.rvm/log/ruby-2.0.0-p0/make.log
There has been an error while running make. Halting the installation.

有人遇到过这个问题吗?

-编辑 - -

/Users/admin/.rvm/log/ruby-2.0.0-p0/make.log:

[2013-03-26 18:16:26] make
    CC = gcc-4.2
    LD = ld
    LDSHARED = gcc-4.2 -dynamiclib
    CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -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 -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/libxslt/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include   -I. -I.ext/include/x86_64-darwin12.3.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/libxslt/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib  -install_name /Users/admin/.rvm/rubies/ruby-2.0.0-p0/lib/libruby.2.0.0.dylib -current_version 2.0.0 -compatibility_version 2.0.0  -fstack-protector -Wl,-u,_objc_msgSend  -fstack-protector -Wl,-u,_objc_msgSend  
    SOLIBS = 
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
. ./vm_opts.h
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling time.c
compiling transcode.c
compiling util.c
compiling variable.c
compiling compile.c
compiling debug.c
compiling iseq.c
compiling vm.c
compiling vm_dump.c
compiling vm_backtrace.c
compiling vm_trace.c
compiling thread.c
compiling cont.c
compiling ./enc/ascii.c
compiling ./enc/us_ascii.c
compiling ./enc/unicode.c
compiling newline.c
compiling ./enc/utf_8.c
compiling ./missing/setproctitle.c
compiling dmyext.c
compiling dln.c
compiling encoding.c
compiling dmyversion.c
compiling array.c
linking miniruby
generating encdb.h
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:375: [BUG] Stack consistency error (sp: 30, bp: 28)
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   the more detail of.

-- Control frame information -----------------------------------------------
c:0007 p:0081 s:0030 e:000029 CLASS  /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:375
c:0006 p:0014 s:0026 e:000025 CLASS  /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:354
c:0005 p:0011 s:0024 e:000023 CLASS  /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:341
c:0004 p:0020 s:0020 e:000019 TOP    /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:270 [FINISH]
c:0003 p:---- s:0018 e:000017 CFUNC  :require
c:0002 p:0007 s:0014 E:0006e8 EVAL   ./tool/generic_erb.rb:2 [FINISH]
c:0001 p:0000 s:0002 E:0015f8 TOP    [FINISH]

./tool/generic_erb.rb:2:in `<main>'
./tool/generic_erb.rb:2:in `require'
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:270:in `<top (required)>'
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:341:in `<class:ERB>'
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:354:in `<class:Compiler>'
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/erb.rb:375:in `<class:Scanner>'

-- C level backtrace information -------------------------------------------
0   miniruby                            0x0000000102506e44 rb_vm_bugreport + 164
1   miniruby                            0x00000001023de15e report_bug + 302
2   miniruby                            0x00000001023de414 rb_bug + 180
3   miniruby                            0x00000001024fcec0 vm_exec_core + 32080
4   miniruby                            0x00000001024fd09e vm_exec + 94
5   miniruby                            0x00000001024fdf7a rb_iseq_eval + 266
6   miniruby                            0x00000001023e2d72 rb_load_internal + 306
7   miniruby                            0x00000001023e44c1 rb_require_safe + 1313
8   miniruby                            0x00000001024ecc84 call_cfunc_1 + 20
9   miniruby                            0x00000001024f3146 vm_call_cfunc + 1046
10  miniruby                            0x0000000102501d00 vm_call_method + 224
11  miniruby                            0x00000001024f8383 vm_exec_core + 12819
12  miniruby                            0x00000001024fd09e vm_exec + 94
13  miniruby                            0x00000001024fde4e rb_iseq_eval_main + 206
14  miniruby                            0x00000001023e14df ruby_exec_internal + 111
15  miniruby                            0x00000001023e24c2 ruby_run_node + 82
16  miniruby                            0x00000001023a85df main + 79
17  libdyld.dylib                       0x00007fff8544f7e1 start + 0

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

* Loaded script: ./tool/generic_erb.rb

* Loaded features:

    0 enumerator.so
    1 /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/cgi/util.rb

[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

/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/fileutils.rb:111: [BUG] Stack consistency error (sp: 38, bp: 36)
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   the more detail of.

-- Control frame information -----------------------------------------------
c:0006 p:0038 s:0038 e:000037 CLASS  /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/fileutils.rb:111
c:0005 p:0035 s:0034 e:000033 CLASS  /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/fileutils.rb:107
c:0004 p:0009 s:0032 e:000031 TOP    /Users/admin/.rvm/src/ruby-2.0.0-p0/lib/fileutils.rb:85 [FINISH]
c:0003 p:---- s:0030 e:000029 CFUNC  :require
c:0002 p:0098 s:0026 E:002668 EVAL   ./tool/mkconfig.rb:11 [FINISH]
c:0001 p:0000 s:0002 E:0001f8 TOP    [FINISH]

./tool/mkconfig.rb:11:in `<main>'
./tool/mkconfig.rb:11:in `require'
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/fileutils.rb:85:in `<top (required)>'
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/fileutils.rb:107:in `<module:FileUtils>'
/Users/admin/.rvm/src/ruby-2.0.0-p0/lib/fileutils.rb:111:in `<module:NoWrite>'

-- C level backtrace information -------------------------------------------
0   miniruby                            0x0000000101179e44 rb_vm_bugreport + 164
1   miniruby                            0x000000010105115e report_bug + 302
2   miniruby                            0x0000000101051414 rb_bug + 180
3   miniruby                            0x000000010116fec0 vm_exec_core + 32080
4   miniruby                            0x000000010117009e vm_exec + 94
5   miniruby                            0x0000000101170f7a rb_iseq_eval + 266
6   miniruby                            0x0000000101055d72 rb_load_internal + 306
7   miniruby                            0x00000001010574c1 rb_require_safe + 1313
8   miniruby                            0x000000010115fc84 call_cfunc_1 + 20
9   miniruby                            0x0000000101166146 vm_call_cfunc + 1046
10  miniruby                            0x0000000101174d00 vm_call_method + 224
11  miniruby                            0x000000010116b383 vm_exec_core + 12819
12  miniruby                            0x000000010117009e vm_exec + 94
13  miniruby                            0x0000000101170e4e rb_iseq_eval_main + 206
14  miniruby                            0x00000001010544df ruby_exec_internal + 111
15  miniruby                            0x00000001010554c2 ruby_run_node + 82
16  miniruby                            0x000000010101b5df main + 79
17  libdyld.dylib                       0x00007fff8544f7e1 start + 0
18  ???                                 0x0000000000000009 0x0 + 9

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

* Loaded script: ./tool/mkconfig.rb

* 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: *** [encdb.h] Abort trap: 6
make: *** Waiting for unfinished jobs....
make: *** [.rbconfig.time] Abort trap: 6
4

2 回答 2

20

确保安装最新版本Command Line Tools for Xcode并遵循以下说明:

rvm get stable
rvm autolibs enable
rvm install ruby || rvm install ruby --with-gcc=clang
于 2013-03-27T09:03:52.923 回答
1

从 '/etc/rvmrc' 中删除带有 'rvm_autolibs_flag=' 的行,请手动清理它,然后

rvm get stable
rvm autolibs enable
rvm install ruby || rvm install ruby --with-gcc=clang
于 2013-06-07T01:42:53.407 回答