nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.4k stars 328 forks source link

Can't build using rbenv #224

Closed naaaaaaaaaaaf closed 5 years ago

naaaaaaaaaaaf commented 5 years ago
$ ./configure ruby
configuring Ruby module
checking for Ruby library ... not found
checking for Ruby library in /home/naf/.rbenv/versions/2.6.0/lib ... not found

./configure: error: no Ruby found.

rbenv version: 1.1.1-40-g483e7f9 ruby version: 2.6.0 OS: Fedora29

mar0x commented 5 years ago

Please attach produced 'build/autoconf.err' file for investigation.

naaaaaaaaaaaf commented 5 years ago
configuring Ruby module ...
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
----------------------------------------
checking for Ruby library
/usr/bin/ld: cannot find -lruby
collect2: error: ld returned 1 exit status
----------

        #include <ruby.h>

        int main() {
            ruby_init();
            return ruby_cleanup(0);
        }
----------
cc -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes -Werror -g -I/home/naf/.rbenv/versions/2.6.0/include/ruby-2.6.0/x86_64-linux -I/home/naf/.rbenv/versions/2.6.0/include/ruby-2.6.0 -o build/autotest build/autotest.c -lruby -lm
----------
----------------------------------------
checking for Ruby library in /home/naf/.rbenv/versions/2.6.0/lib
/usr/bin/ld: cannot find -lruby
collect2: error: ld returned 1 exit status
----------

            #include <ruby.h>

            int main() {
                ruby_init();
                return ruby_cleanup(0);
            }
----------
cc -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes -Werror -g -I/home/naf/.rbenv/versions/2.6.0/include/ruby-2.6.0/x86_64-linux -I/home/naf/.rbenv/versions/2.6.0/include/ruby-2.6.0 -o build/autotest build/autotest.c -L/home/naf/.rbenv/versions/2.6.0/lib -Wl,-rpath,/home/naf/.rbenv/versions/2.6.0/lib -lruby -lm
----------
lexborisov commented 5 years ago

Hi @naaaaaaaaaaaf

Please, build ruby with shared library:

CONFIGURE_OPTS="--enable-shared" rbenv install 2.6.0

this should solve your problem.

naaaaaaaaaaaf commented 5 years ago

@lexborisov Thank you, it was solved!