当前位置:  开发笔记 > 编程语言 > 正文

即使安装了libv8,也不会安装Gem therubyracer

如何解决《即使安装了libv8,也不会安装Gemtherubyracer》经验,为你挑选了1个好方法。

libv8使用此命令在Windows上安装了gem:

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

然后,当我尝试安装therubyracer它给我很长的错误消息:

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

我理解的是,therubyracer希望找到v8.我已经安装了已经拥有它的Node.js.甚至可以使用它吗?或者还有其他的therubyracer解决方案?



1> Shin Kim..:

此错误出现在OS X El Capitan中.只是v8@3.15用来therubyracer.

brew install v8@3.15
bundle config --local build.libv8 --with-system-v8
bundle config --local build.therubyracer --with-v8-dir=/usr/local/opt/v8@3.15
bundle install

检查此问题的详细信息

推荐阅读
mobiledu2402852357
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有