安装“libv8” gem用于“therubyracer”在Windows上 [英] Installing "libv8" gem for "therubyracer" on Windows

查看:565
本文介绍了安装“libv8” gem用于“therubyracer”在Windows上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Windows上安装 therubyracer gem。使用使用 Ruby 2.1.6 32位并运行

  gem install libv8 -v'3.16.14.3' -  -  --with-system-v8 

这是我得到的错误:

 使用本机扩展安装therubyracer 0.12.1 

Gem :: Ext :: BuildError:错误:无法构建gem原生扩展。

C:/Ruby21/bin/ruby.exe extconf.rb
检查main()in -lpthread ... no
检查v8.h ... no
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或头文件。检查mkmf.log文件以获取更多详细信息。您可能
需要配置选项。

提供的配置选项:
--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 = C:/ Ruby21 / bin / ruby​​
--with-pthreadlib
--without-pthreadlib
- 启用 - 调试
--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
C:/在
`configure'中的Ruby21 / lib / ruby​​ / gems / 2.1.0 / gems / libv8-3.16.14.3 / ext / libv8 / location.rb:50:你已经选择使用V8的版本你的系统(Libv8 :: Location :: System :: NotFoundError)
和* not *与libv8 ruby​​gem绑定的系统。但是,
无法找到。请确保您有一个与安装的3.16.14.3兼容的
v8版本。如果
位置处于非标准
位置

谢谢,
Mgmt
可能需要使用特殊的--with-v8-dir选项
来自C:/Ruby21/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7:在`configure_makefile'中
来自extconf.rb:32 :在< main>'

extconf失败,退出代码1

Gem文件将保持安装在C:/Ruby21/lib/ruby/gems/2.1.0 /gems/therubyracer-0.12.1进行检查。
记录到C的结果:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/therubyracer-0.12.1/gem_make.out
安装时发生错误therubyracer(0.12.1)和Bundler无法继续。
确保`gem install therubyracer -v'0.12.1'`捆绑成功。


解决方案


查尔斯洛厄尔:


不,我无法知道目前在windows上安装这个gem。问题在于,目前没有针对Windows的 libv8 gem的预编译版本,而源版本仅与* nix兼容。它不一定非要这样,它只是需要有人花时间为Windows编译工作。 https://github.com/fractaloop/libv8



也就是说,Windows应该带有一个JScript,即Microsoft JavaScript运行时,它的rails(通过 execjs < a>)会自动检测和使用,所以你应该能够删除你对 therubyracer 的依赖。


I'm having trouble installing therubyracer gem on Windows.

Using Ruby 2.1.6 32-bit and running

gem install libv8 -v '3.16.14.3' -- --with-system-v8

This is the error I get:

Installing therubyracer 0.12.1 with native extensions

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

    C:/Ruby21/bin/ruby.exe extconf.rb
checking for main() in -lpthread... no
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=C:/Ruby21/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
C:/Ruby21/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/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.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location

thanks,
The Mgmt

        from C:/Ruby21/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
        from extconf.rb:32:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/therubyracer-0.12.1 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/therubyracer-0.12.1/gem_make.out
An error occurred while installing therubyracer (0.12.1), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.1'` succeeds before bundling.

解决方案

Solution from Charles Lowell:

No, there is no way that I know of to currently install this gem on windows. The problem is that there is currently no pre-compiled version of the libv8 gem for Windows, and the source version is only compatible with *nix. It does not necessarily have to be that way, it just requires somebody taking the time to make the compile work for Windows. https://github.com/fractaloop/libv8

That said, Windows should come with a JScript, the Microsoft JavaScript runtime, which rails (via execjs) will automatically detect and use, so you should be able to just remove your dependency on therubyracer.

这篇关于安装“libv8” gem用于“therubyracer”在Windows上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆