jaro_winkler
jaro_winkler copied to clipboard
MacOS install failture
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
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
I switched from ruby 2.7.0
to 2.7.2
locally to fix it.
Maybe you can go to 2.3:latest
?
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