我therubyracer
在 Windows 上安装 gem 并收到有关“'patch' 未被识别为内部或外部命令、可运行程序或批处理文件”的错误。我需要这个 gem,因为当我尝试使用 less 时,它说要安装 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
提到的日志文件不包含比上述更多的信息。
我什至不知道从哪里开始解决这个问题。
注意:我安装了 ruby 开发工具包C:\RubyDevKit-mingw64-64-4.7.2
编辑:
我这样做是因为我正在运行jekyll并尝试将Less 用于 Jekyll。
基于stackoverflow 上的其他一些答案,我安装了 libv8 gem 的旧版本(3.11.8.0)。它安装正确,但没有修复错误。看起来有点像 therubyracer 包含它自己的 libv8 副本。
我安装了“therubyracer_for_windows”包。但在那之后,当我尝试运行 jekyll serve 时,我得到了错误:
Configuration file: C:/data/adamantworks/Adamantworks.Web-jekyll/_config.yml
jekyll 2.5.2 | Error: uninitialized constant V8::JSError
因此,似乎其中包含与 jekyll 不兼容的过时内容。我卸载了 therubyracer_for_windows。