运行时在OS X Mountain Lion上安装ffi gem的错误
问题描述:
我想在我的OS X Mountain Lion上安装ffi gem(所以我可以运行Octopress)并且遇到错误。运行时在OS X Mountain Lion上安装ffi gem的错误
运行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
任何帮助表示赞赏。
答
它看起来像ffi
宝石不喜欢在路径中的空间,因为你已经在config
已经检查它不是使用这个路径的红宝石,必须是在编译宝石的过程中的东西。
为了让编译你需要摆脱空间的,有办法少:在不包含空格的路径
- 重装RVM,首先你需要在
~/.rvmrc
改变rvm_path
的位置,这就是“安全“的选择, - 将rvm直接移动到
rvm_path
指向的路径 -sudo rm -rf /chetanshenoy.rvm && sudo mv "/Volumes/Secondary - HDD/Users/chetanshenoy/.rvm" /chetanshenoy.rvm
- 这应该工作,因为ruby没有主目录的记录,但它不能确定带空格的路径是否保存在任何位置 - 以防万一的问题使用解决方案1.
+0
感谢您的帮助。我最终编辑了gem并更新了libffi Makefile。我最终需要弄清楚如何在不使用任何设置的情况下移动'rvm'。 – 2012-08-14 18:50:35
答
如Issue with installing ImageMagick and rmagick on Mountain Lion所述,ffi似乎被配置为查找'gcc-4.2',所以一旦我更新了我的Apple command line tools(我可能不需要这样做),我创建了一个符号链接来使ffi安装配置幸福:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
可以包括'/ chetanshenoy.rvm /红宝石/红宝石1.9.3-P194/config' - 最佳使用[要点](https://gist.github.com),因为这文件相当大。 – mpapis 2012-08-13 17:34:39
@mpapis这是配置:[https://gist.github.com/3342924](https://gist.github.com/3342924) – 2012-08-13 19:34:29
这是我的想法 - 这可能是错误的方式'ffi'已经安装,ruby没有空间路径的记录,你是否尝试过最新版本或预编译的'ffi'? – mpapis 2012-08-13 21:22:13