在Windows7 64位上安装jslint-v8 Ruby gem的问题

在Windows 7(64位)上的Rally App SDK 2.0p环境设置期间出现问题。 我从rubyinstaller.org安装了Ruby 1.8.7-p358并设法安装了rake Ruby gem。 但我在安装jslint-v8 gem时遇到问题。 它依赖于therubyracerlibv8 gems,需要使用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中正确安装它? 谢谢!

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

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

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

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

https://github.com/cowboyd/libv8

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

试试这个gem install libv8 -v’3.16.14.3′ – –with-system-v8

参考: 安装libv8时出错:错误:无法构建gem本机扩展

要在安装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,但这不应该是一个问题

希望有所帮助。

Interesting Posts