1

我正在尝试在我的 OS X Mountain Lion 上安装 ffi gem(这样我就可以运行 Octopress)并且遇到了错误。

运行gem install install ffi -v '1.0.11'给出以下输出:

/chetanshenoy.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile

make
Configuring libffi
/Volumes/Secondary - HDD/Users/chetanshenoy/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/configure: line 642: test: too many arguments
/Volumes/Secondary - HDD/Users/chetanshenoy/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/configure: line 642: test: too many arguments
configure: WARNING: Libtool does not cope well with whitespace in `pwd`
cd "/Volumes/Secondary - HDD/Users/chetanshenoy/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi" && make
make "AR_FLAGS=" "CC_FOR_BUILD=" "CFLAGS=" "CXXFLAGS=" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "JC1FLAGS=" "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make" "MAKEINFO=/bin/sh "/Volumes/Secondary - HDD/Users/chetanshenoy/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/missing" --run makeinfo " "PICFLAG=" "PICFLAG_FOR_TARGET=" "RUNTESTFLAGS=" "SHELL=/bin/sh" "exec_prefix=/usr/local" "infodir=/usr/local/share/info" "libdir=/usr/local/lib" "prefix=/usr/local" "AR=ar" "AS=as" "CC=gcc-4.2" "CXX=c++" "LD=ld" "NM=/usr/bin/nm" "RANLIB=ranlib" "DESTDIR=" all-recursive
make[2]: *** No rule to make target `HDD/Users/chetanshenoy/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/missing --run makeinfo '.  Stop.
make[1]: *** [all] Error 2
make: *** ["/Volumes/Secondary] Error 2

任何帮助表示赞赏。

4

2 回答 2

1

看起来ffigem也不喜欢路径中的空格,因为您已经检查过config它不是使用此路径的ruby,必须是编译gem的过程中的东西。

要使其编译,您需要摆脱空格,有几种方法:

  1. 在没有空格的路径中重新安装 rvm,首先您需要更改rvm_path位置~/.rvmrc,这是“安全”的选择,
  2. 将 rvm 直接移动到指向的路径rvm_path- sudo rm -rf /chetanshenoy.rvm && sudo mv "/Volumes/Secondary - HDD/Users/chetanshenoy/.rvm" /chetanshenoy.rvm- 这应该可以工作,因为 ruby​​ 没有主目录的记录,但它不能确定带空格的路径是否保存在任何位置 - 如果出现问题,请使用解决方案 1。
于 2012-08-14T05:42:39.370 回答
1

正如在 Mountain Lion 上安装 ImageMagick 和 rmagick 的问题中所述,ffi 似乎被配置为查找“gcc-4.2”,所以一旦我更新了我的Apple 命令行工具(我可能需要也可能不需要这样做),我创建了一个符号链接以使 ffi 安装配置满意:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
于 2013-03-28T14:27:13.050 回答