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

support windows #18

Open
tonytonyjan opened this issue Oct 1, 2017 · 14 comments
Open

support windows #18

tonytonyjan opened this issue Oct 1, 2017 · 14 comments

Comments

@tonytonyjan
Copy link
Owner

No description provided.

@bbatsov
Copy link

bbatsov commented Jun 12, 2018

I guess this just re-emerged in the context of RuboCop - see rubocop/rubocop#5989

Perhaps on Windows you can just fallback automatically to the pure Ruby version?

@tonytonyjan
Copy link
Owner Author

The issue seems similar to this: https://stackoverflow.com/questions/19176136/make-is-not-recognized-as-internal-or-external-command

In theory, it should have worked on Windows since the extension is implemented with CRuby's interface, but I never had tested jaro_winkler on windows before.

I'll confirm this issue on windows 10 later.

@tonytonyjan
Copy link
Owner Author

tonytonyjan commented Jun 13, 2018

Oops, I suddenly realized I misread rubocop/rubocop#5989, it's JRuby on windows platform.

@rtdevlin
Copy link

rtdevlin commented Jul 2, 2018

I'm still seeing this issue on 64 bit Ruby2.3.1 on Windows. Popped up with recent Rubocop update

@tonytonyjan
Copy link
Owner Author

@rtdevlin Would you paste the full error message here, thank you!

@rtdevlin
Copy link

rtdevlin commented Jul 3, 2018

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20180703-277200-1fzi9md.rb extconf.rb

creating Makefile

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler

make "DESTDIR=" clean

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler

make "DESTDIR="

generating jaro_winkler_ext-x64-mingw32.def

make: Error -- Don't know how to make /C/Ruby23-x64/include/ruby-2.3.0/ruby.h

make failed, exit code 255

@tonytonyjan
Copy link
Owner Author

@rtdevlin I am not able to reproduce your issue:

C:\Users\User>ver

Microsoft Windows [Version 10.0.17134.48]

C:\Users\User>ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]

C:\Users\User>gem install jaro_winkler
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed jaro_winkler-1.5.1
Parsing documentation for jaro_winkler-1.5.1
Installing ri documentation for jaro_winkler-1.5.1
Done installing documentation for jaro_winkler after 0 seconds
1 gem installed

C:\Users\User>ruby -rjaro_winkler -e 'puts JaroWinkler.distance "tony", "tomy"'
0.8666666666666667

I guess It might have something to do with your building environment. Are you able to install other C extensions? For example: gem install thin

@rtdevlin
Copy link

rtdevlin commented Jul 4, 2018

I wasn't able to install thin, but I know I've installed gems that required the Devkit and it worked. The only difference I see right now is Windows versions. I'm going to try to install on my home machine (the issue I'm having is at work, else I wouldn't be using Windows)

@rtdevlin
Copy link

rtdevlin commented Jul 4, 2018

Was able to install on Windows 10. Thanks for looking into the issue, I'll continue trying to figure out what's wrong with my machine

@lsegal
Copy link

lsegal commented Mar 28, 2019

Still running into issues on this. Windows 10 x64:

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

    current directory: C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.2/ext/jaro_winkler
C:/tools/ruby25/bin/ruby.exe -I C:/tools/ruby25/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190327-192408-kgbemo.rb extconf.rb
creating Makefile

current directory: C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.2/ext/jaro_winkler
make "DESTDIR=" clean

current directory: C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.2/ext/jaro_winkler
make "DESTDIR="
generating jaro_winkler_ext-x64-mingw32.def
make: *** No rule to make target '/C/tools/ruby25/include/ruby-2.5.0/ruby.h', needed by 'adj_matrix.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.2 for inspection.
Results logged to C:/tools/ruby25/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/jaro_winkler-1.5.2/gem_make.out

@kenliu
Copy link

kenliu commented Mar 31, 2019

I was able to fix this by uninstalling ruby (installed via Chocolatey) and manually installing RubyInstaller+DevKit https://rubyinstaller.org/downloads/

@Dainii
Copy link

Dainii commented Jul 29, 2019

If it can help someone, I had the same issue and the problem was the path of my ruby installation. It was installed in "C:\Program Files\ruby" and Make does not seems to like the space in the path of the executables.

So I moved the folder elsewhere (like "C:\DATA") and it works now.

doetlingerlukas added a commit to doetlingerlukas/dotfiles that referenced this issue Mar 1, 2020
@okmanideep
Copy link

For folks who use scoop on Windows

$ scoop install ruby
$ scoop install msys2
$ ridk install
# PRESS ENTER (installs MSYS2 + MINGW Development Kit)  

This should make gem install jaro_winkler work just fine

@Slach
Copy link

Slach commented Mar 19, 2023

@okmanideep thanks for sharing. it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants