question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

installation error (cannot install libv8-node (16.10.0.0))

See original GitHub issue

System

  • OS: Windows 10 64-bit
  • Ruby version: 3.1.2p20 (2022-04-12 revision 4491bb740a)
  • Bundler version: 2.3.15
  • rubygems version: 3.3.15

Problem I’ve had problems installing a package which has mini_racer as a dependency (see here), and so trying to isolate the issue I tried to install mini_racer by itself, but I cannot. Specifically, I get An error occurred while installing libv8-node (16.10.0.0), and Bundler cannot continue.

I’ve tried to follow the installation troubleshooting instructions but it doesn’t seem to help.

Reproducible example

Just to be sure there aren’t old versions messing things up:

$ gem uninstall --all mini_racer libv8-node
Gem 'mini_racer' is not installed
Gem 'libv8-node' is not installed

I create a Gemfile with gem 'mini_racer'

Then as per the FAQ: $ bundle lock --add-platform x64-mingw-ucrt

Then time to install:

$ bundle
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using bundler 2.3.15
Fetching libv8-node 16.10.0.0
Installing libv8-node 16.10.0.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
C:/myprograms/Ruby31-x64/bin/ruby.exe -I
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0 -r
./siteconf20220602-12104-lkb65l.rb extconf.rb
creating Makefile
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/builder.rb:12:in
`build_libv8!': failed to download node 16.10.0 (Libv8::Node::BuilderError)
from
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/location.rb:30:in
`install!'
        from extconf.rb:9:in `<main>'
==== in
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
==== running
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/libexec/download-node

extconf failed, exit code 1

Gem files will remain installed in
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0 for
inspection.
Results logged to
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/libv8-node-16.10.0.0/gem_make.out

C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/ext/builder.rb:95:in
`run'
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:47:in
`block in build'
  C:/myprograms/Ruby31-x64/lib/ruby/3.1.0/tempfile.rb:317:in `open'
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/ext/builder.rb:164:in
`build_extension'
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/ext/builder.rb:198:in
`block in build_extensions'
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/ext/builder.rb:195:in
`each'
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/ext/builder.rb:195:in
`build_extensions'
C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems/installer.rb:851:in
`build_extensions'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/source/rubygems.rb:204:in
`install'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/installer/gem_installer.rb:54:in
`install'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/installer/parallel_installer.rb:186:in
`do_install'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/worker.rb:62:in
`apply_func'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/worker.rb:57:in
`block in process_queue'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/worker.rb:54:in
`loop'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/worker.rb:54:in
`process_queue'
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/worker.rb:91:in
`block (2 levels) in create_threads'

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

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

I then try to install it myself, but still doesn’t work:

$ gem install mini_racer --platform x64-mingw-ucrt
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing mini_racer:
        ERROR: Failed to build gem native extension.

    current directory: C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
C:/myprograms/Ruby31-x64/bin/ruby.exe -I C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0 -r ./siteconf20220602-8952-p8m3se.rb extconf.rb
creating Makefile
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/builder.rb:12:in `build_libv8!': failed to download node 16.10.0 (Libv8::Node::BuilderError)
        from C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/location.rb:30:in `install!'
        from extconf.rb:9:in `<main>'
==== in C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
==== running C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/libexec/download-node

extconf failed, exit code 1

Gem files will remain installed in C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0 for inspection.
Results logged to C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/libv8-node-16.10.0.0/gem_make.out
$ gem install libv8-node --platform x64-mingw-ucrt
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing libv8-node:
        ERROR: Failed to build gem native extension.

    current directory: C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
C:/myprograms/Ruby31-x64/bin/ruby.exe -I C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0 -r ./siteconf20220602-17288-tlm9zt.rb extconf.rb
creating Makefile
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/builder.rb:12:in `build_libv8!': failed to download node 16.10.0 (Libv8::Node::BuilderError)
        from C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/location.rb:30:in `install!'
        from extconf.rb:9:in `<main>'
==== in C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
==== running C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/libexec/download-node

extconf failed, exit code 1

Gem files will remain installed in C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0 for inspection.
Results logged to C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/libv8-node-16.10.0.0/gem_make.out

And to just be comprehensive, I still have problems if I don’t specify the platform whether I do it via a Gemfile or do it myself, e.g. :

$ gem install mini_racer
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing mini_racer:
        ERROR: Failed to build gem native extension.

    current directory: C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
C:/myprograms/Ruby31-x64/bin/ruby.exe -I C:/myprograms/Ruby31-x64/lib/ruby/site_ruby/3.1.0 -r ./siteconf20220602-12156-gee44r.rb extconf.rb
creating Makefile
C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/builder.rb:12:in `build_libv8!': failed to download node 16.10.0 (Libv8::Node::BuilderError)
        from C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/location.rb:30:in `install!'
        from extconf.rb:9:in `<main>'
==== in C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
==== running C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/libexec/download-node

extconf failed, exit code 1

Gem files will remain installed in C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0 for inspection.
Results logged to C:/myprograms/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/libv8-node-16.10.0.0/gem_make.out

Any advice? I’m completely new to Ruby, apologies if I’m missing something obvious.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
tisbacommented, Nov 30, 2022

@Adsidera Can you open a separate issue please? This one is most likely because of Windows. Please check the troubleshooting section in the README first (esp. b/c it looks like your platform is missing) and include your Gemfile and Gemfile.lock.

1reaction
lloekicommented, Aug 1, 2022

IIUC from the logs, this is a “pure windows” Ruby built on MinGW? (no Cygwin, no WSL2)

I don’t think this is supposed to be supported yet, although we have a task open for it:

https://github.com/rubyjs/libv8-node/issues/9

Read more comments on GitHub >

github_iconTop Results From Across the Web

libv8-node (16.10.0.0) installation error · Issue #691 - GitHub
An error occurred while installing libv8-node (16.10.0.0), and Bundler cannot continue. In Gemfile: mini_racer was resolved to 0.6.2, which depends on ...
Read more >
Error installing libv8: ERROR: Failed to build gem native ...
try this one: gem install libv8 -v '3.16.14.3' -- --with-system-v8. Note : Because libv8 is the interface for the V8 engine used by ......
Read more >
What is libv8 and Why its Installation Fails - DEV Community ‍ ‍
Background When I cloned a project and tried to run bundle install, I receive the error... Tagged with ruby, rails, bundler, libv8.
Read more >
How to fix libv8 "bad version" error when using mini_racer
I upgraded to MacOS Catalina, then wiped my partition and did a fresh install. In a few hours, I had almost everything running....
Read more >
an error occurred while installing json (2.6.2), and bundler ...
An error occurred while installing libv8-node (16.10.0.0), and Bundler cannot continue. In Gemfile: mini_racer was resolved to 0.6.2, which depends on ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found