Falla la actualización del paquete en ffi


Estoy intentando hacer un bundle update en mi aplicación rails pero obtengo el siguiente error:

Installing ffi (1.0.11) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb 
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/lib
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
    from extconf.rb:9:in `<main>'


Gem files will remain installed in /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11 for inspection.
Results logged to /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/ext/ffi_c/gem_make.out
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:530:in `block in build_extensions'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `each'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `build_extensions'
    from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in `install'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/source.rb:90:in `block in install'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:82:in `preserve_paths'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/source.rb:89:in `install'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:73:in `block in install_gem_from_spec'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:97:in `with_build_args'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:72:in `install_gem_from_spec'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:56:in `block in run'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:55:in `run'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:12:in `install'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/cli.rb:271:in `update'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/bin/bundle:13:in `<top (required)>'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/bin/bundle:19:in `load'
    from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/bin/bundle:19:in `<main>'

¿Alguna idea?

Author: Kyle Decot, 2012-05-14

11 answers

Me encontré con un problema similar a este ayer.

Pude resolverlo usando estos pasos:

Https://github.com/carlhuda/bundler/blob/1-0-stable/ISSUES.md

Esencialmente, había un problema con mi paquete y limpiar las cosas y reconstruir las cosas desde cero lo resolvió.

Los pasos se repiten aquí:

# remove user-specific gems and git repos
rm -rf ~/.bundle/ ~/.gem/

# remove system-wide git repos and git checkouts
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/

# remove project-specific settings and git repos
rm -rf .bundle/

# remove project-specific cached .gem files
rm -rf vendor/cache/

# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock

# try to install one more time
bundle install

Aunque, dado el mensaje en el texto de salida:

Tienes que instalar herramientas de desarrollo primero.

Eso me hace pensar que es posible que no haya instalado el Apple Xcode Developer Tools. ¿Has comprobado eso? (Creo que están disponibles en la Mac App Store.)

 27
Author: Kevin Bedell,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-05-16 01:45:43

Una vez instalado gcc-4.2 de brew, necesita crear un enlace simbólico de la misma:

ln -s /usr/bin/gcc /usr/bin/gcc-4.2
 10
Author: kiero,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-10-12 00:13:31

Para Xcode 5 y posteriores:

$ xcode-select --install

Para instalar las Herramientas de Línea de Comandos.

 10
Author: Lasse Bunk,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-11-02 14:23:29

Por si acaso intenta ejecutar

Sudo / usr / bin / gcc

Probablemente verá el acuerdo de licencia, así que desplácese por él, escriba "agree" e intente instalar gem de nuevo.

 5
Author: DiS,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-25 02:51:25

Tenga en cuenta:

Si ha actualizado Xcode recientemente, es posible que solo necesite abrir Xcode y aceptar el último acuerdo.

Tuve el mismo problema y recientemente instalé una actualización a Xcode (v6. 1) y lo resolví con estos pasos:

  1. abrir Xcode
  2. aceptar un nuevo acuerdo
  3. actualización del paquete de repetición
 5
Author: theotherjim,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-02-12 17:01:17

Instalar "Herramientas de línea de comandos" a través de Xcode hizo el truco.

Si tiene preferencias de Xcode 4.5 open > Descargas > Seleccione la pestaña Components y haga clic en Install junto a Command Line Tools.

Aunque instalé desde Xcode, también puede descargar el paquete sin él desde Descargas de desarrolladores de Apple y la búsqueda de "Herramientas de línea de comandos".

 4
Author: Dan Sandland,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-11-26 03:29:05

Para mí simplemente no tenía gcc instalado, resolver en Ubuntu por:

sudo apt install build-essential
 2
Author: Konstantin Pereiaslov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-07-26 11:03:32

Tuve que aceptar la licencia de usuario de Xcode:

Al ejecutar sudo xcrun cc debería aparecer la versión cli del Xcode acuerdo de licencia. Otra opción es abrir Xcode.app y aceptar en la GUI.

Posiblemente causado por la actualización de OSX.

Http://blog.tomhennigan.co.uk/post/62238548037/agreeing-to-the-xcode-license-from-the-command

 1
Author: i.bajrai,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-29 07:02:37

Mac Osx 10.10.2 yosemite

 CC=/usr/bin/i686-apple-darwin11-llvm-gcc-4.2 gem install ffi

Y eso es todo-compruebe que tiene compilador 4.2 en /usr/bin que puede enganchar en

ls /usr/bin|grep gcc|grep 4.2

No tiene que borrar todas sus gemas locales o anular enlaces simbólicos para hacer esto - es una pérdida de tiempo y probablemente creará más problemas que resuelve.

Tenga en cuenta que la ruta de la papelera puede ser diferente si necesita instalar a través de brew

brew install apple-gcc42 
 0
Author: lfender6445,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-03-25 19:14:34

También método:

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
bundle update

ffi.h se encuentra en ${SDKROOT}/usr/include/ffi/ffi.h.

 0
Author: Gracjan Polak,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-22 15:31:02

Ubuntu Trusty LTS 14.04

Necesitaba cambiar de ruby 2.2.1 a 2.3.0 para soportar versiones más recientes de gema en la aplicación Rails.

Solución:

  1. rvm get stable
  2. rvm remove 2.3.0
  3. rvm install 2.3.0
  4. bundle install
 0
Author: Alex M.,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-26 08:57:49