gpt4 book ai didi

ruby - gem 安装失败,无法识别 'patch' (windows)

转载 作者:数据小太阳 更新时间:2023-10-29 08:14:01 24 4
gpt4 key购买 nike

我在 Windows 上安装 therubyracer 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

提到的日志文件仅包含上述信息。

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

注意:我在 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 serve 时,我得到了错误:

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

所以它似乎包含一些与 jekyll 不兼容的过时的东西。我卸载了 therubyracer_for_windows。

最佳答案

我遇到了同样的问题。制作 bundle update libv8 并完成 ;)

关于ruby - gem 安装失败,无法识别 'patch' (windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31115226/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com