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

Installing re2 on windows fails #55

Closed
bragi92 opened this issue Nov 30, 2021 · 3 comments
Closed

Installing re2 on windows fails #55

bragi92 opened this issue Nov 30, 2021 · 3 comments
Labels
stale Issues that haven't had any activity for at least 60 days

Comments

@bragi92
Copy link

bragi92 commented Nov 30, 2021

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

@mudge
Copy link
Owner

mudge commented Dec 1, 2021

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=?

@mudge
Copy link
Owner

mudge commented Nov 20, 2022

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.

@mudge mudge added the stale Issues that haven't had any activity for at least 60 days label Nov 20, 2022
@mudge mudge closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2022
@stanhu
Copy link
Collaborator

stanhu commented Aug 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues that haven't had any activity for at least 60 days
Projects
None yet
Development

No branches or pull requests

3 participants