tonytonyjan / jaro_winkler

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

Mojave compatibility issues #22

Closed KernelPanicAUS closed 5 years ago

KernelPanicAUS commented 5 years ago

This gem seems to have some compatibility issues with Mac os x Mojave.

$ sudo gem install rubocop

current directory: /Library/Ruby/Gems/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181104-27213-qfkou.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
make "DESTDIR="
make: *** No rule to make target `/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `adj_matrix.o'.  Stop.

make failed, exit code 2

Any ideas how this can be fixed?

tonytonyjan commented 5 years ago

Thanks for reporting, unfortunately, I am not able to reproduce with ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin18]. Can you give more details about your environment?

It may have something to do with building environment. I wonder if you are able to install any C-extension like nokogiri? For example gem install -f nokogiri.

KernelPanicAUS commented 5 years ago

that seems to have blown up as well

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18 -I/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS  conftest.c  -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib -L.     -lruby.2.3.0  -lpthread -ldl -lobjc  "
In file included from conftest.c:1:
In file included from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
         ^~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

I'm using a new Mac and have only just upgraded to Mojave, so its a very clean environment and have not installed these gems at all prior to the upgrade.

I have double checked and I definitely have the xcode command line tools installed...

rodrigobdz commented 5 years ago

I'm also having this issue. I have Xcode Command Line Tools installed. Related to https://github.com/rubocop-hq/rubocop/issues/5989.

It happens when I try to install either rubocop or jaro_winkler.

rubocop installation error ![image](https://user-images.githubusercontent.com/14152377/48070883-2df53e80-e1d9-11e8-863c-c1f893ddc655.png)
jaro_winkler installation error ![image](https://user-images.githubusercontent.com/14152377/48070827-1322ca00-e1d9-11e8-8671-dd4e6ee7194f.png)
tiiiecherle commented 5 years ago

It seems like a lot of people are affected by the issue.

https://github.com/Homebrew/homebrew-cask/issues/52775

Would be nice to see a fix in the near future. Thanks

tonytonyjan commented 5 years ago

@rodrigobdz The images you gave does not contain informations, you have to provde the contents ofgem_make.out file. Since I am not able to reproduce, I need your help, thanks!

rodrigobdz commented 5 years ago

gem_make.out does not contain any additional information. image

stevenzeck commented 5 years ago

I'm also getting this error:

make: *** No rule to make target `/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `adj_matrix.o'.  Stop.

I don't have a dir named universal-darwin18 there, I have universal-darwin17. Guessing that's an Apple issue with Mojave?

KernelPanicAUS commented 5 years ago

I've managed to overcome this issue with the following steps:

Since then I've managed to install a whole bunch of gems with native extensions without any issues.

This leads me to suspect that the version of ruby shipped with Mojave is missing a bunch of C headers that make installing any gems with native extensions a massive pain in the rear.

It might be worth adding something to the Readme for Mojave users đŸ¤”

EricFromCanada commented 5 years ago

The problem is that Apple can't decide whether to keep that include directory around…

Strange.