Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jbudlender opened this issue Jun 2, 2022 · 8 comments · Fixed by #268
Closed

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

jbudlender opened this issue Jun 2, 2022 · 8 comments · Fixed by #268

Comments

@jbudlender
Copy link

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.

@ghost
Copy link

ghost commented Jun 29, 2022

Hello have you solved the probelm ?

@jbudlender
Copy link
Author

In my use-case (see the mentioned issue above) someone figured out a workaround which avoided using mini_racer completely. I haven't looked at this issue since, but just tried gem install mini_racer now and got an error again so doesn't seem to be resolved for me.

@lloeki
Copy link
Collaborator

lloeki commented 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:

rubyjs/libv8-node#9

@jbudlender
Copy link
Author

jbudlender commented Aug 1, 2022

Yes, a pure Windows installation afaik. Thanks for the note about Windows support. I will notify the creator of the package I'm using (which has mini_racer as a dependency).

@tisba
Copy link
Collaborator

tisba commented Sep 29, 2022

@lloeki I'm not very familiar with Windows these days. Would it be fair to say, that mini_racer (currently) does not support Windows? I'd put this in mini_racer's README.

@lloeki
Copy link
Collaborator

lloeki commented Sep 29, 2022

It does not right now.

@Adsidera
Copy link

I have this same issue also on an Intel-based Macbook, for a Rails 6 application using Ruby 2.7.7:

Could not find gem 'libv8-node (~> 16.10.0.0)' with platforms 'ruby', 'x86_64-linux', which is required by gem 'mini_racer', in any of the sources.

The source contains the following gems matching 'libv8-node (~> 16.10.0.0)':
  * libv8-node-16.10.0.0-x86_64-darwin

Any advice?

@tisba
Copy link
Collaborator

tisba commented 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.

tisba added a commit to tisba/mini_racer that referenced this issue Dec 9, 2022
Cell9 added a commit to Cell9/Web-palvelinohjelmointi-Ruby-on-Rails that referenced this issue Dec 30, 2022
Unable to install 'mini_racer' dependencies on Windows based machines.

rubyjs/mini_racer#252

alshedivat/al-folio#691
SamSaffron pushed a commit that referenced this issue Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants