在Windows 7 64位上使用eslint-v8 Ruby gem安装的问题

时间:2012-05-30 08:33:17

标签: ruby windows-7 sdk jslint rally

在Windows 7(64位)上的Rally App SDK 2.0p环境设置期间出现问题。我从rubyinstaller.org安装了Ruby 1.8.7-p358并设法安装了rake Ruby gem。但我在安装 jslint-v8 gem时遇到问题。它依赖于 therubyracer libv8 宝石,需要使用Ruby DevKit构建。在安装过程中,我收到以下错误:

C:\ruby> gem install jslint-v8
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing jslint-v8:
    ERROR: Failed to build gem native extension.

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

Gem files will remain installed in C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4 for inspection.
Results logged to C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out

有谁知道如何在Win7中正确安装? 谢谢!

3 个答案:

答案 0 :(得分:7)

您尝试安装的gem取决于libv8 gem,它只不过是Google V8 JavaScript VM的包装器。

没有针对Windows的预编译libv8(就像Linux或OSX一样),这意味着它需要从头开始构建V8。

围绕V8构建过程的代码不是很可移植,更不用说编译libv8需要安装Python :-P

直到今天,根据存储库说明,没有人能够按照Windows上的libv8预编译说明进行操作:

https://github.com/cowboyd/libv8

很抱歉无法为您提供更好的回复。

答案 1 :(得分:1)

试试这个 gem install libv8 -v'3.16.14.3' - --with-system-v8

参考:Error installing libv8: ERROR: Failed to build gem native extension

答案 2 :(得分:-1)

要在安装gem时在Windows中构建gem原生扩展,通常还需要安装DevKit: http://rubyinstaller.org/downloads/ - 转到devkit下载链接
他们的github页面有安装说明:https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

我还建议使用Ruby 1.9.3而不是1.8.7,但这不应该是一个很大的问题

希望有所帮助。