2010-10-31 17 views
36

Estoy ejecutando 1.9.2 con raíles 3.ruby-debug error de instalación: error al construir gema extensión nativa

Estoy usando rvm.

que hice:

sudo gem install ruby-gem 

y tengo:

Building native extensions. This could take a while... 
ERROR: Error installing ruby-debug: 
    ERROR: Failed to build gem native extension. 

/Users/blankman/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb 
Can't handle 1.9.x yet 
*** 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 
    --without-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/blankman/.rvm/rubies/ruby-1.9.2-head/bin/ruby 


Gem files will remain installed in /Users/blankman/.rvm/gems/ruby-1.9.2-head/gems/linecache-0.43 for inspection. 
Results logged to /Users/blankman/.rvm/gems/ruby-1.9.2-head/gems/linecache-0.43/ext/gem_make.out 

ACTUALIZACIÓN

Agregado:

joya 'rubí debug19'

y cuando manojo de ejecutar la instalación me sale:

Fetching source index for http://rubygems.org/ 
Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.0.rc2) 
Using builder (2.1.2) 
Using i18n (0.4.1) 
Using activemodel (3.0.0.rc2) 
Using erubis (2.6.6) 
Using rack (1.2.1) 
Using rack-mount (0.6.13) 
Using rack-test (0.5.6) 
Using tzinfo (0.3.23) 
Using actionpack (3.0.0.rc2) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.8) 
Using mail (2.2.7) 
Using actionmailer (3.0.0.rc2) 
Using arel (1.0.1) 
Using activerecord (3.0.0.rc2) 
Using activeresource (3.0.0.rc2) 
Using archive-tar-minitar (0.5.2) 
Using bundler (1.0.3) 
Using columnize (0.3.1) 
Using ruby_core_source (0.1.4) 
Installing linecache19 (0.5.11) with native extensions /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

/Users/blankman/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb 
checking for vm_core.h... no 
checking for vm_core.h... no 
*** 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 
    --without-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/blankman/.rvm/rubies/ruby-1.9.2-head/bin/ruby 
    --with-ruby-dir 
    --without-ruby-dir 
    --with-ruby-include 
    --without-ruby-include=${ruby-dir}/include 
    --with-ruby-lib 
    --without-ruby-lib=${ruby-dir}/lib 
/Users/blankman/.rvm/gems/[email protected]/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:268:in `block (2 levels) in read': Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p14.tar.gz and all I got was a 404! (URI::NotFoundError) 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1186:in `block in transport_request' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:2334:in `reading_body' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1185:in `transport_request' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1169:in `request' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1162:in `block in request' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:627:in `start' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:1160:in `request' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:239:in `block in read' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:286:in `connect' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:234:in `read' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:128:in `download' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/tempfile.rb:320:in `open' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:51:in `create_makefile_with_core' 
    from extconf.rb:20:in `<main>' 
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p14.tar.gz 


Gem files will remain installed in /Users/blankman/.rvm/gems/[email protected]/gems/linecache19-0.5.11 for inspection. 
Results logged to /Users/blankman/.rvm/gems/[email protected]/gems/linecache19-0.5.11/ext/trace_nums/gem_make.out 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions' 
    from /Users/blankman/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/source.rb:100:in `install' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/installer.rb:55:in `block in run' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `block in each' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/installer.rb:44:in `run' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/installer.rb:8:in `install' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/cli.rb:221:in `install' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/vendor/thor/task.rb:22:in `run' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/vendor/thor.rb:246:in `dispatch' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/vendor/thor/base.rb:389:in `start' 
    from /Users/blankman/.rvm/gems/[email protected]/gems/bundler-1.0.3/bin/bundle:13:in `<top (required)>' 
    from /Users/blankman/.rvm/gems/[email protected]/bin/bundle:19:in `load' 
    from /Users/blankman/.rvm/gems/[email protected]/bin/bundle:19:in `<main>' 
blankmans-MacBook-Pro:hz blankman$ 
+2

¿Ha resuelto su problema? También recibo este error cuando uso 1.9.2-head: las versiones anteriores de 1.9.2 no parecen tener problemas. –

Respuesta

14

la gema ruby-debug no es compatible a Ruby 1.9.2. Es necesario utilizar la gema rubí debug19

Así que cambiar en su Gemfile utilizar éste

gem 'ruby-debug19' 
+3

recibo un error al ejecutar la instalación de paquete ahora. – Blankman

50

El problema aquí puede ser que el script de instalación se va fuera para obtener los archivos de Ruby de cabecera a través de Internet (para construir la gema depuradora en contra) pero no los encuentra para el nivel de parche particular de Ruby que está buscando. Esto es lo que está pasando en la línea de salida

Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p14.tar.gz and all I got was a 404! (URI::NotFoundError) 

Como solución se puede apuntar a su copia local de la fuente de Rubí, que RVM ya se ha utilizado para construir el rubí en su máquina. Aquí va ...

gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head/ 

Muchas gracias a Dirk en el siguiente enlace, que ayudó a resolver este

+0

Gracias hombre !!!! ¡Esto me estaba matando! – Jonathan

+1

Esto también funciona para instalaciones sin rvm, simplemente cambie el valor de --with-ruby-include = para que apunte a una copia extraída de la fuente. (Es posible que deba ejecutar como sudo en determinados entornos). –

+3

¿Hay alguna solución para Windows? – Chris

0

Tuve un problema similar (problema compilando extensiones nativas) trabajando en vpn detrás del firewall y teniendo la variable de entorno http_proxy establecida. El instalador de este caso no pudo recuperar el archivo ruby ​​tar. Cerré vpn y desinstalé la variable http_proxy y luego instalé con éxito la gema. Creo que --with-ruby-include es una alternativa.

0

La instalación de gem ruby-debug-base19x también falló debido a problemas de conexión mediante el uso del proxy cntlm y "--with-ruby-include" no funcionó para mí. Instalar la gema sin un proxy funcionó sin problemas.

0

la gema ruby-debug no es compatible a Ruby 1.9.2 y posteriores. reemplazar joya 'rubí debug19' con la siguiente Es necesario utilizar la gema rubí debug19 Así que cambiar en su Gemfile utilizar éste

joya 'rubí debug19'

+0

Duplicado del comentario anterior: http://stackoverflow.com/a/4062959/817496 – RedBassett

0

Para las ventanas, buscar su dir rubí para vm_core.h y luego usa ese directorio como tu ruta de inclusión. Para mí, eso es

gem install ruby-debug-base19 -- --with-ruby-include=C:\JRuby\lib\native\include\ruby-1.9.3-p392 

Luego tuve que comprobar:

C:\JRuby\lib\ruby\gems\shared\gems\linecache19-0.5.12\ext\trace_nums\gem_make.out 

y mover rubí/ruby.h incluyen en el directorio anterior.

Ahora tengo otro error, solucionelo un poco más tarde ...

Cuestiones relacionadas