Installing re2 on windows fails
Closed this issue · 3 comments
Command I was using : gem install re2
ERROR: Error installing re2:
ERROR: Failed to build gem native extension.
current directory: C:/ruby26/lib/ruby/gems/2.6.0/gems/re2-1.4.0/ext/re2
C:/ruby26/bin/ruby.exe -I C:/ruby26/lib/ruby/2.6.0 -r ./siteconf20211130-1608-xneu9.rb extconf.rb
checking for -lstdc++... yes
checking for stdint.h... yes
checking for rb_str_sublen()... yes
checking for -lre2... no
You must have re2 installed and specified with --with-re2-dir, please see https://github.com/google/re2/wiki/Install
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/ruby26/bin/$(RUBY_BASE_NAME)
--with-re2-dir
--without-re2-dir
--with-re2-include
--without-re2-include=${re2-dir}/include
--with-re2-lib
--without-re2-lib=${re2-dir}/lib
--with-stdc++lib
--without-stdc++lib
--with-re2lib
--without-re2lib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/ruby26/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/re2-1.4.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/ruby26/lib/ruby/gems/2.6.0/gems/re2-1.4.0 for inspection.
Results logged to C:/ruby26/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/re2-1.4.0/gem_make.out
Can someone point me to the correct method of installing re2 and its necessary dependencies on windows?
I was trying to install this within a docker container running mcr.microsoft.com/windows/servercore:ltsc2019
Hi @bragi92,
Unfortunately, I have never tested Windows support nor do I have access to a Windows machine for testing. If you are able to compile and install the underlying Google re2 library (it seems like you might be able to use CMake and Visual Studio to do this) then you could try providing the location of its install directory when installing the gem with --with-re2-dir=
?
As there's been no activity on this issue for nearly a year, I'll close it in a week unless there's an update.
I should note that the current v2.0.x
branch builds and tests Windows precompiled gems, so once v2.x is released this should make this gem just work.