2012-08-12 11 views
5

he estado tratando de instalar FFI en OSX 10.8 travésgem install -v FFI '1.1.5' OSX 10.8

gem install ffi -v '1.1.5' 

con el resultado

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 

He tratado de seguir

An error occured while installing ffi (1.1.2), and Bundler cannot continue

y

Not able to install some gems after mountain lion upgrade

sin mucha suerte.

Respuesta

0

Parece que ffi insiste en construir una versión de 32 bits mientras su sistema ejecuta 64 bits.

Hay muy probablemente dos formas de continuar:

  1. intenta utilizar la última versión de la gema gem install ffi - pero esto no tiene que trabajar - ya que esto tiene que ser fijo en la biblioteca,
  2. compilación 32 bits rubí rvm install 1.9.3-n32 --32 - pero esto también no tiene que trabajar como la mayoría de las bibliotecas más probable será compilada para 64 bits, por lo que podría no recopilar o compilar y cuestiones presentes
2

Mi instalación FFI falló con un mensaje de error bastante similares:

mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386; (if [ ! -f "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/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.9.0/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.9.0/ext/ffi_c/libffi-i386': 
configure: error: C compiler cannot create executables 

vi cc xcrun en el comando y tratar de ejecutarlo manualmente me dio el mensaje de Apple que no me había acordado XCode herramientas de línea de comandos ' acuerdo de licencia. Después de sudo xcrun cc, la instalación tuvo éxito.

$ xcrun cc 
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. 
$ sudo xcrun cc 
You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode. 
Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf' 
... 

`` `

+0

Esto sucede no sólo después de una primera instalación de XCode, pero en cualquier momento de Apple cambia la licencia. De modo que una actualización de XCode puede hacer que las herramientas de XCode dejen de funcionar hasta que haya aceptado el nuevo acuerdo de licencia. – Technosophos

Cuestiones relacionadas