宝石安装失败了'补丁'无法识别(窗口)

时间:2015-06-29 12:04:03

标签: ruby gem rubygems therubyracer

我正在Windows上安装therubyracer gem并收到有关"' patch'不被识别为内部或外部命令,可操作程序或批处理文件。"我需要这个宝石,因为当我尝试使用更少时,它会说要安装therubyracer。

这是完整的输出:

C:\>ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]

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

    C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150629-3268-otarv8.rb extconf.rb
creating Makefile
'patch' is not recognized as an internal or external command,
operable program or batch file.
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/patcher.rb:50:in `block (2 levels) in patch!': failed to apply
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/patcher.rb:48:in `each'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/patcher.rb:48:in `block in patch!'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/patcher.rb:44:in `open'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/patcher.rb:44:in `patch!'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/builder.rb:57:in `block in build_libv8!'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/builder.rb:52:in `chdir'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/builder.rb:52:in `build_libv8!'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9/ext/libv8/location.rb:24:in `install!'
        from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.9 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/libv8-3.16.14.9/gem_make.out

提到的日志文件不包含比上述更多的信息。

我甚至不知道从哪里开始解决这个问题。

注意:我在C:\RubyDevKit-mingw64-64-4.7.2

安装了ruby开发工具包

修改

我正在做这一切,因为我正在运行jekyll并尝试使用Less for Jekyll

基于其他一些answers on stackoverflow,我安装了libv8 gem的旧版本(3.11.8.0)。它安装正确,但没有修复错误。看起来有点像therubyracer包含自己的libv8副本。

我安装了"therubyracer_for_windows"个包。但在那之后,当我试图运行jekyll服务时,我得到了错误:

Configuration file: C:/data/adamantworks/Adamantworks.Web-jekyll/_config.yml
jekyll 2.5.2 | Error:  uninitialized constant V8::JSError

所以似乎有一个过时的东西与jekyll不兼容。我卸载了therubyracer_for_windows。

1 个答案:

答案 0 :(得分:-1)

我遇到了同样的问题。让bundle update libv8及其完成;)