tonytonyjan / jaro_winkler

Ruby & C implementation of Jaro-Winkler distance algorithm which supports UTF-8 string.
MIT License
192 stars 29 forks source link

MacOS install failture #36

Open zzj0402 opened 4 years ago

zzj0402 commented 4 years ago

Reproduce

sudo gem install jaro_winkler

Environment

MacOS Mojave 10.14.5 (18F2059)

Output

Building native extensions. This could take a while...
ERROR:  Error installing jaro_winkler:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -I /Library/Ruby/Site/2.3.0 -r ./siteconf20191212-98820-dz3tkp.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/jaro_winkler-1.5.4 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.4/gem_make.out
tonytonyjan commented 4 years ago

Hi @zzj0402,

Your issue might be caused by the building environment instead of jaro_winkler gem itself. I wonder if you are able to install any other native extension with your Mojave environment. For example:

sudo gem install nokogiri
dennisvandehoef commented 3 years ago

I switched from ruby 2.7.0 to 2.7.2 locally to fix it. Maybe you can go to 2.3:latest?

parluciaga commented 2 years ago

It seems there's a problem with Xcode's ruby, which prevents this gem from installing. Symlinking the expected ruby version solved the problem for me. See https://stackoverflow.com/questions/63729369/commonmarker-gem-cannot-be-installed-needed-for-jekyll-macos