使用Clang安装Ruby 1.9.3故障

我试图在Mac OS X Lion上安装Ruby 1.9.3,方法与我在此处发现的相同:

基本上它是:

rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr 

但是,这次Clang在--with-readline-dir选项上抛出错误:

 Larson:~ andrewjl$ rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr clang: error: unsupported option '--with-readline' clang: error: unsupported option '--with-opt-dir=/Users/andrewjl/.rvm/usr' 

这是Clang的问题吗? 有谁知道怎么解决这个问题?

编辑

在尝试Shigeya的答案后,我得到了这个错误:

 Larson:~ andrewjl$ rvm install 1.9.3-p125 --patch xcode-debugopt-fix-r34840.diff --with-readline-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr --with-tcl-lib=/usr --with-tk-lib=/usr Installing Ruby from source to: /Users/andrewjl/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)... ruby-1.9.3-p125 - #fetching ruby-1.9.3-p125 - #downloading ruby-1.9.3-p125, this may take a while depending on your connection... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 9505k 100 9505k 0 0 52267 0 0:03:06 0:03:06 --:--:-- 50727 ruby-1.9.3-p125 - #extracting ruby-1.9.3-p125 to /Users/andrewjl/.rvm/src/ruby-1.9.3-p125 ruby-1.9.3-p125 - #extracted to /Users/andrewjl/.rvm/src/ruby-1.9.3-p125 Applying patch 'xcode-debugopt-fix-r34840.diff' (located at /Users/andrewjl/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff) ruby-1.9.3-p125 - #autoreconf Error running 'autoreconf', please read /Users/andrewjl/.rvm/log/ruby-1.9.3-p125/autoreconf.log ruby-1.9.3-p125 - #configuring Error running ' ./configure --prefix=/Users/andrewjl/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-readline --with-opt-dir=/Users/andrewjl/.rvm/usr --with-openssl --with-tcl-lib=/usr --with-tk-lib=/usr --with-libyaml --with-gcc=clang ', please read /Users/andrewjl/.rvm/log/ruby-1.9.3-p125/configure.log There has been an error while running configure. Halting the installation. 

这是日志文件错误:

 /usr/local/include/fuse/fuse_compat.h:69:10: fatal error: 'sys/statfs.h' file not found #include  ^ clang: error: unable to execute command: Broken pipe: 13 clang: error: clang frontend command failed due to signal 2 (use -v to see invocation) clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information. clang: note: diagnostic msg: Error generating preprocessed source(s). yes checking for strip... strip checking for prefix of external symbols... _ checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for if make is GNU make... yes checking for nroff... /usr/bin/nroff .ext/include/x86_64-darwin11.4.0/ruby/config.h updated ruby library version = 1.9.1 configure: creating ./config.status config.status: creating Makefile configure: WARNING: unrecognized options: --with-readline, --with-openssl, --with-tcl-lib, --with-tk-lib, --with-libyaml In file included from :143: In file included from :1: In file included from /usr/local/include/fuse/fuse.h:26: /usr/local/include/fuse/fuse_common.h:32:2: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags! #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags! ^ In file included from :143: In file included from :1: In file included from /usr/local/include/fuse/fuse.h:857: /usr/local/include/fuse/fuse_compat.h:69:10: fatal error: 'sys/statfs.h' file not found #include  ^ clang: error: unable to execute command: Broken pipe: 13 clang: error: clang frontend command failed due to signal 2 (use -v to see invocation) clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information. clang: note: diagnostic msg: Error generating preprocessed source(s). configure: WARNING: unrecognized options: --with-readline, --with-openssl, --with-tcl-lib, --with-tk-lib, --with-libyaml config.status: creating ruby-1.9.pc ./configure: line 18932: syntax error near unexpected token `(' ./configure: line 18932: ` sed 's/{\$([^(){}]*)[^{}]*}//g' ${srcdir}/common.mk' 

请参阅此答案。

尽管ruby-1.9.3-p125和ruby-1.9.3-p194都支持clang,但通常不推荐使用rubng安装Ruby。

(注意:我必须先接受编辑提案,然后进行编辑。非常感谢您的贡献。)

Interesting Posts