2016-01-05 25 views
5

ho installato libv8 gioiello finestre utilizzando questo comando:Gem therubyracer non si installa anche se libv8 è installato

gem install libv8 -- --with-system-v8 

Poi, quando provo ad installare therubyracer mi dà messaggio di errore lungo:

Installing therubyracer 0.12.2 with native extensions 

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

current directory: D:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/therubyracer- 0.12.2/ext/v8 
D:/Ruby21-x64/bin/ruby.exe -r ./siteconf20160105-4924-101vdyd.rb extconf.rb 
checking for main() in -lpthread... yes 
checking for v8.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=D:/Ruby21-x64/bin/ruby 
--with-pthreadlib 
--without-pthreadlib 
--enable-debug 
--disable-debug 
--with-v8-dir 
--without-v8-dir 
--with-v8-include 
--without-v8-include=${v8-dir}/include 
--with-v8-lib 
--without-v8-lib=${v8-dir}/lib 
D:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError) 
and *not* the one that is bundle with the libv8 rubygem. However, 
it could not be located. please make sure you have a version of 
v8 that is compatible with 3.16.14.13 installed. You may 
need to special --with-v8-dir options if it is in a non-standard 
location 

thanks, 
The Mgmt 

Quello che ho capito è che therubyracer vuole trovare v8. Ho installato Node.js che già lo ha. È persino possibile usarlo? O ci sono altre soluzioni per il terubyracer?

+0

Non si può fare più di tanto, perché ho appena uso Linux, ma è necessario il file "devel" (fonte) per v8. 'controllando per v8.h ... no' –

+0

Come ha detto Paulo, hai bisogno della versione di sviluppo per la v8. Potresti provare a installare' nodejs' sulla tua scatola invece di aggirarla con 'therubyracer', se stai provando a esegui solo le tue attività 'rake'. –

+0

Ho scaricato il raw source di v8 da github, come installare therubyracer con esso? –

risposta

24

Questo bug appare in OS X El Capitan. Basta usare [email protected] per therubyracer.

brew install [email protected] 
bundle config --local build.libv8 --with-system-v8 
bundle config --local build.therubyracer --with-v8-dir=/usr/local/opt/[email protected] 
bundle install 

Check detail of this issue

+1

Grazie per aver funzionato alla grande. Stavo ricevendo anche quel messaggio: "Assicurati che' gem install therubyracer -v '0.12.2'' riesca prima del raggruppamento. " –

+1

Concordo, usando il terubyracer 0.12.2 e impostando queste opzioni di configurazione del pacchetto ha funzionato per me. Ho usato questa opzione principalmente perché risolve il problema in un modo che posso effettivamente utilizzare con un Gemfile E le offerte non causano problemi strani sulla distribuzione – iturgeon

+1

'Errore: nessuna formula disponibile con il nome" v8-315 "' – jameshfisher

Problemi correlati