在Mac OS 10.5.8上通过RVM安装Ruby 1.8.7-p302时运行make时出错

运行“rvm install 1.8.7-p302”提供以下反馈:

rich-macbook:~ rich$ rvm install 1.8.7-p302 Installing Ruby from source to: /Users/rich/.rvm/rubies/ruby-1.8.7-p302, this may take a while depending on your cpu(s)... ruby-1.8.7-p302 - #fetching ruby-1.8.7-p302 - #extracted to /Users/rich/.rvm/src/ruby-1.8.7-p302 (already extracted) Applying patch 'stdout-rouge-fix' (located at /Users/rich/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch) ERROR: Error running 'patch -F 25 -p1 -N -f <"/Users/rich/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/rich/.rvm/log/ruby-1.8.7-p302/patch.apply.stdout-rouge-fix.log ruby-1.8.7-p302 - #configuring ruby-1.8.7-p302 - #compiling ERROR: Error running 'make ', please read /Users/rich/.rvm/log/ruby-1.8.7-p302/make.log ERROR: There has been an error while running make. Halting the installation. 

这是安装它的第二次尝试; 第一次安装补丁很好,但Ruby本身运行失败make。 我最近安装了Ruby 1.9.3-p0没问题。

以下是上述日志文件的输出。

patch.apply.stdout-胭脂fix.log

 [2011-12-01 08:06:45] patch -F 25 -p1 -N -f <"/Users/rich/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch" patching file lib/mkmf.rb Hunk #1 FAILED at 201. 1 out of 1 hunk FAILED -- saving rejects to file lib/mkmf.rb.rej 

make.log里:

 [2011-12-01 08:07:04] make /usr/bin/gcc-4.2 -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -L. -arch x86_64 -bind_at_load main.o dmydln.o libruby-static.a -ldl -lobjc -o miniruby rbconfig.rb unchanged cc -dynamiclib -undefined suppress -flat_namespace -install_name /Users/rich/.rvm/rubies/ruby-1.8.7-p302/lib/libruby.dylib -current_version 1.8.7 -compatibility_version 1.8 array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o -o libruby.1.8.7.dylib ld warning: in array.o, file is not of required architecture ld warning: in bignum.o, file is not of required architecture ld warning: in class.o, file is not of required architecture ld warning: in compar.o, file is not of required architecture ld warning: in dir.o, file is not of required architecture ld warning: in dln.o, file is not of required architecture ld warning: in enum.o, file is not of required architecture ld warning: in enumerator.o, file is not of required architecture ld warning: in error.o, file is not of required architecture ld warning: in eval.o, file is not of required architecture ld warning: in file.o, file is not of required architecture ld warning: in gc.o, file is not of required architecture ld warning: in hash.o, file is not of required architecture ld warning: in inits.o, file is not of required architecture ld warning: in io.o, file is not of required architecture ld warning: in marshal.o, file is not of required architecture ld warning: in math.o, file is not of required architecture ld warning: in numeric.o, file is not of required architecture ld warning: in object.o, file is not of required architecture ld warning: in pack.o, file is not of required architecture ld warning: in parse.o, file is not of required architecture ld warning: in process.o, file is not of required architecture ld warning: in prec.o, file is not of required architecture ld warning: in random.o, file is not of required architecture ld warning: in range.o, file is not of required architecture ld warning: in re.o, file is not of required architecture ld warning: in regex.o, file is not of required architecture ld warning: in ruby.o, file is not of required architecture ld warning: in signal.o, file is not of required architecture ld warning: in sprintf.o, file is not of required architecture ld warning: in st.o, file is not of required architecture ld warning: in string.o, file is not of required architecture ld warning: in struct.o, file is not of required architecture ld warning: in time.o, file is not of required architecture ld warning: in util.o, file is not of required architecture ld warning: in variable.o, file is not of required architecture ld warning: in version.o, file is not of required architecture ld warning: in dmyext.o, file is not of required architecture compiling Win32API compiling bigdecimal cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/bigdecimal.bundle bigdecimal.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling curses cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/curses.bundle curses.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lncurses -ltermcap -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling dbm cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/dbm.bundle dbm.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling digest cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/digest.bundle digest.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture cp ../.././ext/digest/digest.h ../../.ext/i686-darwin9.8.0 compiling digest/bubblebabble cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/bubblebabble.bundle bubblebabble.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../../libruby.dylib, file is not of required architecture compiling digest/md5 cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/md5.bundle md5init.o md5ossl.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -lcrypto -ldl -lobjc ld warning: in ../../../libruby.dylib, file is not of required architecture compiling digest/rmd160 cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/rmd160.bundle rmd160init.o rmd160ossl.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -lcrypto -ldl -lobjc ld warning: in ../../../libruby.dylib, file is not of required architecture compiling digest/sha1 cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/sha1.bundle sha1init.o sha1ossl.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -lcrypto -ldl -lobjc ld warning: in ../../../libruby.dylib, file is not of required architecture compiling digest/sha2 cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/sha2.bundle sha2.o sha2init.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../../libruby.dylib, file is not of required architecture compiling dl cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/dl.bundle dl.o handle.o ptr.o sym.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture cp dlconfig.h ../../.ext/i686-darwin9.8.0 cp ../.././ext/dl/dl.h ../../.ext/i686-darwin9.8.0 compiling etc cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/etc.bundle etc.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling fcntl cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/fcntl.bundle fcntl.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling gdbm compiling iconv cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/iconv.bundle iconv.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -liconv -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling io/wait cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/io/wait.bundle wait.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../../libruby.dylib, file is not of required architecture compiling nkf cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/nkf.bundle nkf.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling openssl cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/openssl.bundle openssl_missing.o ossl.o ossl_asn1.o ossl_bio.o ossl_bn.o ossl_cipher.o ossl_config.o ossl_digest.o ossl_engine.o ossl_hmac.o ossl_ns_spki.o ossl_ocsp.o ossl_pkcs12.o ossl_pkcs5.o ossl_pkcs7.o ossl_pkey.o ossl_pkey_dh.o ossl_pkey_dsa.o ossl_pkey_ec.o ossl_pkey_rsa.o ossl_rand.o ossl_ssl.o ossl_ssl_session.o ossl_x509.o ossl_x509attr.o ossl_x509cert.o ossl_x509crl.o ossl_x509ext.o ossl_x509name.o ossl_x509req.o ossl_x509revoked.o ossl_x509store.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lssl -lcrypto -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling pty cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/pty.bundle pty.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lutil -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling racc/cparse cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/racc/cparse.bundle cparse.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../../libruby.dylib, file is not of required architecture compiling readline cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/readline.bundle readline.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lreadline -lncurses -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling sdbm cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/sdbm.bundle _sdbm.o init.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling socket cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/socket.bundle socket.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling stringio cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/stringio.bundle stringio.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling strscan cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/strscan.bundle strscan.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling syck cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/syck.bundle bytecode.o emitter.o gram.o handler.o implicit.o node.o rubyext.o syck.o token.o yaml2byte.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling syslog cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/syslog.bundle syslog.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling thread cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/thread.bundle thread.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture compiling tk Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options. compiling tk/tkutil compiling win32ole compiling zlib cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/zlib.bundle zlib.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lz -ldl -lobjc ld warning: in ../../libruby.dylib, file is not of required architecture making ruby /usr/bin/gcc-4.2 -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -L. -arch x86_64 -bind_at_load main.o -lruby -ldl -lobjc -o ruby ld warning: in ./libruby.dylib, file is not of required architecture Undefined symbols: "_ruby_options", referenced from: _main in main.o "_ruby_run", referenced from: _main in main.o "_ruby_init", referenced from: _main in main.o "_ruby_init_stack", referenced from: _main in main.o ld: symbol(s) not found collect2: ld returned 1 exit status make[1]: *** [ruby] Error 1 make: *** [all] Error 2 

如果您需要更多信息,请告诉我们。

编辑:我在阅读这个post后执行了以下步骤: 在Snow Leopard上使用`rvm`安装`ruby-1.8.7-p334`时出错

  1. rvm pkg安装readline
  2. rvm删除1.8.7
  3. rvm清理所有
  4. rvm install ruby​​-1.8.7-p302

这成功安装了补丁,表明它是第一次安装,因此可以忽略任何后续错误。 编译Ruby时仍然出错。 由于make日志文件超出了这篇文章的字符数容量,你可以在这里查看第二个makefile的内容: http : //pastebin.com/MTZjXBdF

没有使用最新版本。 但是可以通过强制它使用rvm安装的readline来使它工作。

rvm install 1.8.7 -C -with-readline-dir = $ rvm_path / usr

完整的步骤是:

  rvm pkg install readline rvm remove 1.8.7 rvm cleanup all rvm install 1.8.7 -C –with-readline-dir=$rvm_path/usr 

感谢Andrew在http://anlek.com/2011/01/rvm-install-1-8-7-p330-fails/上的指针。

我刚用linux和OSX测试过,它似乎已经修好了:

 rvm get head rvm install 1.8.7-p302 --autolibs=3 

还要考虑升级到ruby-2.0.0 – 1.8树将在几个月内不再维护。