当我在 github 项目中运行 Bundle Install 时,出现错误:Installing wdm 0.1.1 with native extensions Gem::Ext::BuildError

问题描述 投票:0回答:1

我正在 githubs-pages 中制作一个作品集网站。该项目需要安装几个软件包。我使用的是安装了 Windows 10 的 Windows 计算机。我按照 github 网站上的说明在此处安装 Jekyll 和 Bundle:

https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll

所以我一步一步按照说明的步骤进行。第一步是安装 2 个软件包:Ruby 和 Bundle。

  1. 我做了这第一步。我访问了 Ruby 的网站,下载并安装了带有 devkit 的 Ruby。我使用
    ridk install
    安装了它,下一步是在不在项目路径中的新命令提示符中运行
    gem install jekyll bundler

然后我运行其他步骤。我为我的项目创建了存储库和文件夹。当我完成第 13 步时,我使用

Bundle Install
。当我这样做时,命令提示符显示此错误:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/wdm-0.1.1/ext/wdm
C:/Ruby33-x64/bin/ruby.exe extconf.rb
checking for -lkernel32... yes
checking for windows.h... yes
checking for ruby.h... yes
checking for HAVE_RUBY_ENCODING_H... yes
checking for rb_thread_call_without_gvl()... yes
creating Makefile

current directory: C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/wdm-0.1.1/ext/wdm
make DESTDIR\= sitearchdir\=./.gem.20240624-30600-ys16cj
sitelibdir\=./.gem.20240624-30600-ys16cj clean

current directory: C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/wdm-0.1.1/ext/wdm
make DESTDIR\= sitearchdir\=./.gem.20240624-30600-ys16cj
sitelibdir\=./.gem.20240624-30600-ys16cj
generating wdm_ext-x64-mingw-ucrt.def
compiling entry.c
compiling memory.c
compiling monitor.c
compiling queue.c
compiling rb_change.c
rb_change.c: In function 'extract_absolute_path_from_notification':
rb_change.c:139:5: warning: 'RB_OBJ_TAINT' is deprecated: taintedness turned out
to be a wrong idea. [-Wdeprecated-declarations]
  139 |     OBJ_TAINT(path);
      |     ^~~~~~~~~
In file included from
C:/Ruby33-x64/include/ruby-3.3.0/ruby/internal/core/rstring.h:30,
from
C:/Ruby33-x64/include/ruby-3.3.0/ruby/internal/arithmetic/char.h:29,
from
C:/Ruby33-x64/include/ruby-3.3.0/ruby/internal/arithmetic.h:24,
                 from C:/Ruby33-x64/include/ruby-3.3.0/ruby/ruby.h:28,
                 from C:/Ruby33-x64/include/ruby-3.3.0/ruby.h:38,
                 from wdm.h:22,
                 from rb_change.c:4:
C:/Ruby33-x64/include/ruby-3.3.0/ruby/internal/fl_type.h:824:1: note: declared
here
  824 | RB_OBJ_TAINT(VALUE obj)
      | ^~~~~~~~~~~~
compiling rb_monitor.c
rb_monitor.c: In function 'rb_monitor_run_bang':
rb_monitor.c:509:29: error: implicit declaration of function
'rb_thread_call_without_gvl' [-Wimplicit-function-declaration]
509 |         waiting_succeeded = rb_thread_call_without_gvl(wait_for_changes,
monitor->process_event, stop_monitoring, monitor);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:248: rb_monitor.o] Error 1

make failed, exit code 2

Gem files will remain installed in
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/wdm-0.1.1 for inspection.
Results logged to
C:/Ruby33-x64/lib/ruby/gems/3.3.0/extensions/x64-mingw-ucrt/3.3.0/wdm-0.1.1/gem_make.out

  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:125:in `run'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:51:in `block in make'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:43:in `each'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:43:in `make'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/ext_conf_builder.rb:42:in `build'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:193:in `build_extension'
C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:227:in `block in
build_extensions'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `each'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `build_extensions'
  C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/installer.rb:852:in `build_extensions'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/rubygems_gem_installer.rb:79:in
`build_extensions'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/source/rubygems.rb:205:in
`install'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/installer/gem_installer.rb:54:in
`install'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/installer/parallel_installer.rb:132:in
`do_install'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/installer/parallel_installer.rb:123:in
`block in worker_pool'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/worker.rb:62:in
`apply_func'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/worker.rb:57:in
`block in process_queue'
  <internal:kernel>:187:in `loop'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/worker.rb:54:in
`process_queue'
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.14/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'

An error occurred while installing wdm (0.1.1), and Bundler cannot continue.

In Gemfile:
  wdm

有人见过这个错误吗?

ruby windows rubygems bundle github-pages
1个回答
0
投票

我知道问题是什么了。我在 Gemfile 中注释掉了 wdm gem 的字段

gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
。我运行了 Bundle install 并且它起作用了。我的网站建好了。

© www.soinside.com 2019 - 2024. All rights reserved.