ruby 无法构建用于安装mini_racer和libv 8-node的gem本机扩展(Windows 10)

dwthyt8l  于 11个月前  发布在  Ruby
关注(0)|答案(1)|浏览(148)

尝试使用bundle exec jekyll serve使用jekyll生成一个网站,并返回:
在本地安装的gem中找不到gem“mini_racer”。请运行bundle install以安装缺少的gem。
所以我做了bundle install
得到了这个错误:

Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Installing libv8-node 18.16.0.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-node-18.16.0.0/ext/libv8-node
D:/Ruby32-x64/bin/ruby.exe extconf.rb
creating Makefile
D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-node-18.16.0.0/ext/libv8-node/builder.rb:12:in
`build_libv8!': failed to download node 18.16.0 (Libv8::Node::BuilderError)
from
D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-node-18.16.0.0/ext/libv8-node/location.rb:30:in
`install!'
        from extconf.rb:15:in `<main>'
==== in
D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-node-18.16.0.0/ext/libv8-node
==== running
D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-node-18.16.0.0/libexec/download-node

extconf failed, exit code 1

An error occurred while installing libv8-node (18.16.0.0), and Bundler cannot
continue.

In Gemfile:
  mini_racer was resolved to 0.8.0, which depends on
    libv8-node

字符串
我也试过gem install libv8,被返回:

Fetching libv8-8.4.255.0.gem
Temporarily enhancing PATH for MSYS/MINGW...
WARNING:  libv8-8.4.255.0 ships with a dangling symlink named vendor/depot_tools/cbuildbot pointing to missing vendor/depot_tools/cros file. Ignoring
WARNING:  libv8-8.4.255.0 ships with a dangling symlink named vendor/depot_tools/chrome_set_ver pointing to missing vendor/depot_tools/cros file. Ignoring
WARNING:  libv8-8.4.255.0 ships with a dangling symlink named vendor/depot_tools/cros_sdk pointing to missing vendor/depot_tools/cros file. Ignoring
Building native extensions. This could take a while...
ERROR:  Error installing libv8:
        ERROR: Failed to build gem native extension.

    current directory: D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-8.4.255.0/ext/libv8
D:/Ruby32-x64/bin/ruby.exe extconf.rb
creating Makefile
The system cannot find the path specified.

D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:57:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError)
        from D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:39:in `build_libv8!'
        from D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-8.4.255.0/ext/libv8/location.rb:24:in `install!'
        from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/libv8-8.4.255.0 for inspection.
Results logged to D:/Ruby32-x64/lib/ruby/gems/3.2.0/extensions/x64-mingw-ucrt/3.2.0/libv8-8.4.255.0/gem_make.out


我还尝试了gem update,它显示我的gem已更新。还有winget install ruby-dev,它刚刚返回:
找不到与输入条件匹配的包。

lymnna71

lymnna711#

我用“therubyracer”代替了“mini_racer”,并成功地完成了Windows系统上的“bundle install”和“bundle exec jekyll s”。希望你能收下这个davice。

相关问题