tonytonyjan / jaro_winkler

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

Installation fails on Ubuntu 18.04 running Ruby 2.6.3 #31

Open sjayanna opened 4 years ago

sjayanna commented 4 years ago

The jaro_winkler gem is failing to install on Ubuntu 18:04 using Ruby 2.6.3 but installs just fine if I revert back to Ruby 2.5.3. I was originally trying to install rubocop and this error popped up.


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

    current directory: /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
/home/sjayanna/.rvm/rubies/ruby-2.6.3/bin/ruby -I /home/sjayanna/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20191018-14011-1xlq2d.rb extconf.rb
creating Makefile

current directory: /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
make "DESTDIR=" clean

current directory: /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
make "DESTDIR="
compiling adj_matrix.c
gcc: error: unrecognized command line option '-Wduplicated-cond'
gcc: error: unrecognized command line option '-Wmisleading-indentation'
gcc: error: unrecognized command line option '-Wrestrict'
gcc: error: unrecognized command line option '-Wimplicit-fallthrough=0'
Makefile:243: recipe for target 'adj_matrix.o' failed
make: *** [adj_matrix.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3 for inspection.
Results logged to /home/sjayanna/.rvm/gems/ruby-2.6.3/extensions/x86_64-linux/2.6.0/jaro_winkler-1.5.3/gem_make.out```
tonytonyjan commented 4 years ago

Hi, @sjayanna, thanks for reporting this issue, unfortunately, I am not able to reproduce with the following Dockerfile.

FROM ubuntu:18.04

RUN apt-get update
RUN apt install -y curl autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
RUN curl https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.gz | tar -xz
RUN cd ruby-2.6.3 && ./configure --disable-install-doc && make install
RUN gem install jaro_winkler
CMD ruby -r jaro_winkler -e 'puts JaroWinkler.distance "tony", "tomy"'

It would be great if you can provide some instructions which can consistenly reportduce the issue.

sjayanna commented 4 years ago

Hi, @tonytonyjan Please see the below debugging information with ruby and linux version. I have installed all the dependencies you did. Maybe the ruby version?Which version of ruby did you pull above?


>> sudo apt install -y curl autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
[sudo] password for sjayanna: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libreadline-dev' instead of 'libreadline6-dev'
autoconf is already the newest version (2.69-11).
autoconf set to manually installed.
bison is already the newest version (2:3.0.4.dfsg-1build1).
build-essential is already the newest version (12.4ubuntu1).
libffi-dev is already the newest version (3.2.1-8).
libgdbm-dev is already the newest version (1.14.1-6).
libgdbm5 is already the newest version (1.14.1-6).
libreadline-dev is already the newest version (7.0-3).
libyaml-dev is already the newest version (0.1.7-2ubuntu3).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
curl is already the newest version (7.58.0-2ubuntu3.8).
libncurses5-dev is already the newest version (6.1-1ubuntu1.18.04).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

[~/code/playground/jaro_winkler] ○                                                                 [ruby-2.6.3] [08:58:55]
>> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
[~/code/playground/jaro_winkler] ○                                                                 [ruby-2.6.3] [08:58:58]
>> ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]

[~/code/playground/jaro_winkler] ○                                                                 [ruby-2.6.3] [08:59:06]
>> gem install jaro_winkler
Building native extensions. This could take a while...
ERROR:  Error installing jaro_winkler:
    ERROR: Failed to build gem native extension.

    current directory: /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
/home/sjayanna/.rvm/rubies/ruby-2.6.3/bin/ruby -I /home/sjayanna/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20191020-24878-19m9yr8.rb extconf.rb
creating Makefile

current directory: /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
make "DESTDIR=" clean

current directory: /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
make "DESTDIR="
compiling adj_matrix.c
gcc: error: unrecognized command line option '-Wduplicated-cond'
gcc: error: unrecognized command line option '-Wmisleading-indentation'
gcc: error: unrecognized command line option '-Wrestrict'
gcc: error: unrecognized command line option '-Wimplicit-fallthrough=0'
Makefile:243: recipe for target 'adj_matrix.o' failed
make: *** [adj_matrix.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/sjayanna/.rvm/gems/ruby-2.6.3/gems/jaro_winkler-1.5.3 for inspection.
Results logged to /home/sjayanna/.rvm/gems/ruby-2.6.3/extensions/x86_64-linux/2.6.0/jaro_winkler-1.5.3/gem_make.out
[~/code/playground/jaro_winkler] ○                                                                 [ruby-2.6.3] [08:59:21]
1 >> ```
marcomoauro commented 4 years ago

i have the same problem of @sjayanna but in my case 2.5.3 not work instead 2.3.8 it work. (I use Ubuntu 18.04)

alanwilter commented 2 years ago

This project seems dead. I only needed because of solargraph.

The issue for me was somehow when doing:


gem install jaro_winkler
...
make: /usr/bin/mkdir: Command not found !!! What ???!!!
...

Fixed with `sudo ln /bin/mkdir /usr/bin/mkdir` on my Ubuntu 20.