gem install ffi -v'1.1.5'osx 10.8

sch*_*erm 5 macos gem

我一直试图在OSX 10.8上安装ffi

gem install ffi -v '1.1.5'
Run Code Online (Sandbox Code Playgroud)

结果

ERROR:  Error installing ffi:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... no
checking for ruby_native_thread_p()... no
checking for rb_thread_call_with_gvl()... no
creating extconf.h
creating Makefile

make
mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386; (if [ ! -f       "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386
Configuring libffi for i386
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: error: in `/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi-i386':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** No targets specified and no makefile found.  Stop.
make: *** ["/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-   i386/.libs/libffi_convenience.a] Error 2


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ffi-1.1.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/gem_make.out
Run Code Online (Sandbox Code Playgroud)

我试过跟随

安装ffi(1.1.2)时发生错误,Bundler无法继续

山狮升级后无法安装一些宝石

没有运气.

mpa*_*pis 0

看起来 ffi 坚持构建 32 位版本,而你的系统正在运行 64 位。

最有可能有两种方式继续:

  1. 尝试使用最新版本的 gem gem install ffi- 但这不一定有效 - 因为这需要在库中修复,
  2. 编译 32 位 rubyrvm install 1.9.3-n32 --32​​ - 但这也不必工作,因为大多数库很可能会编译为 64 位,因此它可能无法编译或编译并出现问题