2012-01-27 15 views
12

He agregado la gema 'sunspot_rails' en mi archivo gema y he ejecutado bundle install. He estado recibiendo errores en la instalación de libv8 y el mensaje de error es como sigue:bundle install/Error in Instalando libv8 (3.3.10.4) en rieles (ejecutándose en Lion)

Installing libv8 (3.3.10.4) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /opt/local/bin/ruby extconf.rb 
*** 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=/opt/local/bin/ruby 
extconf.rb:13: uninitialized constant Gem (NameError) 
Checking for Python... 

Gem files will remain installed in /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4 for inspection. 
Results logged to /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4/ext/libv8/gem_make.out 
An error occured while installing libv8 (3.3.10.4), and Bundler cannot continue. 
Make sure that `gem install libv8 -v '3.3.10.4'` succeeds before bundling. 

Cuando corro gem install -v libv8 '3.3.10.4', el siguiente mensaje de error se imprime:

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

     /opt/local/bin/ruby extconf.rb 
*** 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=/opt/local/bin/ruby 
extconf.rb:13: uninitialized constant Gem (NameError) 
Checking for Python... 

Gem files will remain installed in /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4 for inspection. 
Results logged to /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4/ext/libv8/gem_make.out 

¿Cómo puedo instalar libv8 correctamente?

+0

¿Qué versión de 'gem' está usando? 'gem -v' – tadman

+0

im usando la versión 1.8.15 – user1173832

Respuesta

28

archivo extconf.rb Fuerza para requerir rubygems en la instalación:

RUBYOPT=-rrubygems gem install libv8 -v '3.3.10.4' 

encontrar aquí: https://coderwall.com/p/y1djxq