Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gem build "recipe for target 'stemmer.so' failed"

When installing Jekyll from gem using gem install jekyll, I am getting the following build error. I am using Cygwin on Windows 7 and have built the posix-spawn gem from source prior to installing.

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

    /usr/bin/ruby.exe extconf.rb
creating Makefile

make
gcc -I. -I/usr/include/ruby-1.9.1/x86_64-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.   -ggdb -O2 -pipe   -fno-strict-aliasing   -o porter.o -c porter.c
gcc -I. -I/usr/include/ruby-1.9.1/x86_64-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.   -ggdb -O2 -pipe   -fno-strict-aliasing   -o porter_wrap.o -c porter_wrap.c
rm -f stemmer.so
gcc -shared -o stemmer.so porter.o porter_wrap.o -L. -L/usr/lib -L.  -Wl,--export-all-symbols -Wl,--enable-auto-image-base,--enable-auto-import    -lruby191  -lpthread -lrt -ldl -lcrypt
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lcrypt
collect2: error: ld returned 1 exit status
Makefile:214: recipe for target `stemmer.so' failed
make: *** [stemmer.so] Error 1


Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/ext/gem_make.out

I am using gem v2.0.7, ruby v1.9.3p448, gcc v4.8.1 and g++ v4.8.1

Any ideas? I have no idea when it comes to Ruby gems. I cannot find any information on this "stemmer".

Dan

like image 864
Dan Greaves Avatar asked Feb 15 '23 11:02

Dan Greaves


2 Answers

Turns out the crux of this error was in the cannot find -lcrypt. I installed libcrypt-devel and the gem compiled fine after that.

I think on most native Linux distros, this lib will already be included!

like image 75
Dan Greaves Avatar answered Feb 24 '23 06:02

Dan Greaves


Yeah, Thanks, I installed :-).

Please installing 'libcrypt-devel' in cygwin

like image 30
Praise Song Avatar answered Feb 24 '23 06:02

Praise Song