From tarkhil at over.ru Wed Jan 23 15:56:57 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Wed, 23 Jan 2019 18:56:57 +0300 Subject: unit, PSGI and Mojolicous Message-ID: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> Hello I'm using Mojolicious::Lite, a Perl framework, which should support PSGI. The smallest possible app, however, does not run === #!/usr/bin/env perl use Mojolicious::Lite; get '/' => sub { ? ? my $c = shift; $c->render(text=>'hello'); }; app->start; === 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to run Perl Application: Undefined subroutine &main::1 called. plackup runs it Ok, so there is some incompatibility, which I do not know how to trace. What kind of error in framework can it be and how to trace it? Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Wed Jan 23 16:27:46 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Wed, 23 Jan 2019 19:27:46 +0300 Subject: unit, PSGI and Mojolicous In-Reply-To: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> References: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> Message-ID: <16474258.PnUtnXTaUz@vbart-workstation> On Wednesday 23 January 2019 18:56:57 ????????? ?????????? wrote: > Hello > > I'm using Mojolicious::Lite, a Perl framework, which should support PSGI. > > The smallest possible app, however, does not run > > === > #!/usr/bin/env perl > use Mojolicious::Lite; > get '/' => sub { > my $c = shift; > $c->render(text=>'hello'); > }; > > app->start; > === > > 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to > run Perl Application: > Undefined subroutine &main::1 called. > > plackup runs it Ok, so there is some incompatibility, which I do not > know how to trace. > > What kind of error in framework can it be and how to trace it? > [..] https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack Seems it doesn't behave like PSGI application by default, unless there's a PLACK_ENV environment variable. Unit doesn't set PLACK_ENV by default. wbr, Valentin V. Bartenev From tarkhil at over.ru Wed Jan 23 19:27:39 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Wed, 23 Jan 2019 22:27:39 +0300 Subject: unit, PSGI and Mojolicous In-Reply-To: <16474258.PnUtnXTaUz@vbart-workstation> References: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> <16474258.PnUtnXTaUz@vbart-workstation> Message-ID: <5e6ebc20-7f36-4c5e-0fb1-4a5c661e246f@over.ru> On 23.01.2019 19:27, Valentin V. Bartenev wrote: > On Wednesday 23 January 2019 18:56:57 ????????? ?????????? wrote: >> Hello >> >> I'm using Mojolicious::Lite, a Perl framework, which should support PSGI. >> >> The smallest possible app, however, does not run >> >> === >> #!/usr/bin/env perl >> use Mojolicious::Lite; >> get '/' => sub { >> my $c = shift; >> $c->render(text=>'hello'); >> }; >> >> app->start; >> === >> >> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to >> run Perl Application: >> Undefined subroutine &main::1 called. >> >> plackup runs it Ok, so there is some incompatibility, which I do not >> know how to trace. >> >> What kind of error in framework can it be and how to trace it? >> > [..] > > https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack > > Seems it doesn't behave like PSGI application by default, > unless there's a PLACK_ENV environment variable. > > Unit doesn't set PLACK_ENV by default. Thanks, it was not clear for me. Now it starts, but curl just hangs, with nothing in logs. Attempt to use external type and plackup results in starting plackup but unit not responding. I'll enable debug and try to understand... Alex From tarkhil at over.ru Wed Jan 23 19:40:55 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Wed, 23 Jan 2019 22:40:55 +0300 Subject: unit, PSGI and Mojolicous In-Reply-To: <16474258.PnUtnXTaUz@vbart-workstation> References: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> <16474258.PnUtnXTaUz@vbart-workstation> Message-ID: <49210c83-74b2-fb1b-49aa-2c5acbe7540f@over.ru> On 23.01.2019 19:27, Valentin V. Bartenev wrote: > On Wednesday 23 January 2019 18:56:57 ????????? ?????????? wrote: >> Hello >> >> I'm using Mojolicious::Lite, a Perl framework, which should support PSGI. >> >> The smallest possible app, however, does not run >> >> === >> #!/usr/bin/env perl >> use Mojolicious::Lite; >> get '/' => sub { >> my $c = shift; >> $c->render(text=>'hello'); >> }; >> >> app->start; >> === >> >> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to >> run Perl Application: >> Undefined subroutine &main::1 called. >> >> plackup runs it Ok, so there is some incompatibility, which I do not >> know how to trace. >> >> What kind of error in framework can it be and how to trace it? >> > [..] > > https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack > > Seems it doesn't behave like PSGI application by default, > unless there's a PLACK_ENV environment variable. > > Unit doesn't set PLACK_ENV by default. Sorry for doubleposting, but I've found one strange thing. root at VMNEW:~# telnet localhost 8000 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 200 OK Content-Length: 6 Date: Wed, 23 Jan 2019 19:31:37 GMT Content-Type: text/html;charset=UTF-8 Server: Unit/1.7 Connection closed by foreign host. when I was expecting "hello\n" to be sent as output. You see, Content-Length is correct, but no actual content. Alex From vbart at nginx.com Wed Jan 23 22:58:12 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Thu, 24 Jan 2019 01:58:12 +0300 Subject: unit, PSGI and Mojolicous In-Reply-To: <49210c83-74b2-fb1b-49aa-2c5acbe7540f@over.ru> References: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> <16474258.PnUtnXTaUz@vbart-workstation> <49210c83-74b2-fb1b-49aa-2c5acbe7540f@over.ru> Message-ID: <5045532.UREYO9FB4A@vbart-laptop> On Wednesday, 23 January 2019 22:40:55 MSK ????????? ?????????? wrote: > > On 23.01.2019 19:27, Valentin V. Bartenev wrote: > > On Wednesday 23 January 2019 18:56:57 ????????? ?????????? wrote: > >> Hello > >> > >> I'm using Mojolicious::Lite, a Perl framework, which should support PSGI. > >> > >> The smallest possible app, however, does not run > >> > >> === > >> #!/usr/bin/env perl > >> use Mojolicious::Lite; > >> get '/' => sub { > >> my $c = shift; > >> $c->render(text=>'hello'); > >> }; > >> > >> app->start; > >> === > >> > >> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to > >> run Perl Application: > >> Undefined subroutine &main::1 called. > >> > >> plackup runs it Ok, so there is some incompatibility, which I do not > >> know how to trace. > >> > >> What kind of error in framework can it be and how to trace it? > >> > > [..] > > > > https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack > > > > Seems it doesn't behave like PSGI application by default, > > unless there's a PLACK_ENV environment variable. > > > > Unit doesn't set PLACK_ENV by default. > > Sorry for doubleposting, but I've found one strange thing. > > root at VMNEW:~# telnet localhost 8000 > Trying ::1... > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > GET / HTTP/1.0 > > HTTP/1.1 200 OK > Content-Length: 6 > Date: Wed, 23 Jan 2019 19:31:37 GMT > Content-Type: text/html;charset=UTF-8 > Server: Unit/1.7 > > Connection closed by foreign host. > > when I was expecting "hello\n" to be sent as output. You see, > Content-Length is correct, but no actual content. > [..] We've reproduced the issue and looking into it. Thanks for the report. wbr, Valentin V. Bartenev From alexander.borisov at nginx.com Thu Jan 24 16:13:47 2019 From: alexander.borisov at nginx.com (Alexander Borisov) Date: Thu, 24 Jan 2019 19:13:47 +0300 Subject: unit, PSGI and Mojolicous In-Reply-To: <49210c83-74b2-fb1b-49aa-2c5acbe7540f@over.ru> References: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> <16474258.PnUtnXTaUz@vbart-workstation> <49210c83-74b2-fb1b-49aa-2c5acbe7540f@over.ru> Message-ID: <57653B04-F811-4812-9C6B-5F803F399135@nginx.com> Hi ?????????, Please, try this patch for fix the problem: # HG changeset patch # User Alexander Borisov # Date 1548345939 -10800 # Thu Jan 24 19:05:39 2019 +0300 # Node ID a0a93e0673de88519bfd1062bdb6df166aa5ffa9 # Parent dace60fc4926351efe9322761faf974b0ce7964a Perl: fixed issue with body reading from response object. diff -r dace60fc4926 -r a0a93e0673de src/perl/nxt_perl_psgi.c --- a/src/perl/nxt_perl_psgi.c Wed Jan 23 17:47:53 2019 +0300 +++ b/src/perl/nxt_perl_psgi.c Thu Jan 24 19:05:39 2019 +0300 @@ -51,6 +51,9 @@ static SV *nxt_perl_psgi_call_var_application(PerlInterpreter *my_perl, SV *env, SV *app, nxt_unit_request_info_t *req); +static SV * +nxt_perl_psgi_call_method(PerlInterpreter *my_perl, SV *obj, const char *method, + nxt_unit_request_info_t *req); /* For currect load XS modules */ EXTERN_C void boot_DynaLoader(pTHX_ CV *cv); @@ -84,8 +87,6 @@ SV *result, nxt_unit_request_info_t *req); static int nxt_perl_psgi_result_body_ref(PerlInterpreter *my_perl, SV *sv_body, nxt_unit_request_info_t *req); -static ssize_t nxt_perl_psgi_io_read(nxt_unit_read_info_t *read_info, - void *dst, size_t size); static int nxt_perl_psgi_result_array(PerlInterpreter *my_perl, SV *result, nxt_unit_request_info_t *req); @@ -251,6 +252,43 @@ } +static SV * +nxt_perl_psgi_call_method(PerlInterpreter *my_perl, SV *obj, const char *method, + nxt_unit_request_info_t *req) +{ + SV *result; + + dSP; + + ENTER; + SAVETMPS; + + PUSHMARK(sp); + XPUSHs(obj); + PUTBACK; + + call_method( method, G_EVAL|G_SCALAR); + + SPAGAIN; + + if (SvTRUE(ERRSV)) { + nxt_unit_req_error(req, "PSGI: Failed to call method '%s':\n%s", + method, SvPV_nolen(ERRSV)); + + result = NULL; + } + else { + result = SvREFCNT_inc(POPs); + } + + PUTBACK; + FREETMPS; + LEAVE; + + return result; +} + + static u_char * nxt_perl_psgi_module_create(nxt_task_t *task, const char *script) { @@ -775,43 +813,40 @@ nxt_perl_psgi_result_body_ref(PerlInterpreter *my_perl, SV *sv_body, nxt_unit_request_info_t *req) { - IO *io; - nxt_unit_read_info_t read_info; - nxt_perl_psgi_io_ctx_t io_ctx; - - io = GvIO(SvRV(sv_body)); + SV *data; + int rc; + size_t len; + const char *body; - if (io == NULL) { - return NXT_UNIT_OK; - } + do { + data = nxt_perl_psgi_call_method(my_perl, sv_body, "getline", req); + if (nxt_slow_path(data == NULL)) { + return NXT_UNIT_ERROR; + } - io_ctx.my_perl = my_perl; - io_ctx.fp = IoIFP(io); + body = SvPV(data, len); - read_info.read = nxt_perl_psgi_io_read; - read_info.eof = PerlIO_eof(io_ctx.fp); - read_info.buf_size = 8192; - read_info.data = &io_ctx; + if (len == 0) { + SvREFCNT_dec(data); - return nxt_unit_response_write_cb(req, &read_info); -} - + data = nxt_perl_psgi_call_method(my_perl, sv_body, "close", req); + SvREFCNT_dec(data); -static ssize_t -nxt_perl_psgi_io_read(nxt_unit_read_info_t *read_info, void *dst, size_t size) -{ - ssize_t res; - nxt_perl_psgi_io_ctx_t *ctx; + break; + } + + rc = nxt_unit_response_write(req, body, len); - ctx = read_info->data; - - dTHXa(ctx->my_perl); + SvREFCNT_dec(data); - res = PerlIO_read(ctx->fp, dst, size); + if (nxt_slow_path(rc != NXT_UNIT_OK)) { + nxt_unit_req_error(req, "PSGI: Failed to read line from response"); + return rc; + } - read_info->eof = PerlIO_eof(ctx->fp); + } while (1); - return res; + return NXT_UNIT_OK; } > 23 ???. 2019 ?., ? 22:40, ????????? ?????????? ???????(?): > > > On 23.01.2019 19:27, Valentin V. Bartenev wrote: >> On Wednesday 23 January 2019 18:56:57 ????????? ?????????? wrote: >>> Hello >>> >>> I'm using Mojolicious::Lite, a Perl framework, which should support PSGI. >>> >>> The smallest possible app, however, does not run >>> >>> === >>> #!/usr/bin/env perl >>> use Mojolicious::Lite; >>> get '/' => sub { >>> my $c = shift; >>> $c->render(text=>'hello'); >>> }; >>> >>> app->start; >>> === >>> >>> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to >>> run Perl Application: >>> Undefined subroutine &main::1 called. >>> >>> plackup runs it Ok, so there is some incompatibility, which I do not >>> know how to trace. >>> >>> What kind of error in framework can it be and how to trace it? >>> >> [..] >> >> https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack >> >> Seems it doesn't behave like PSGI application by default, >> unless there's a PLACK_ENV environment variable. >> >> Unit doesn't set PLACK_ENV by default. > > Sorry for doubleposting, but I've found one strange thing. > > root at VMNEW:~# telnet localhost 8000 > Trying ::1... > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > GET / HTTP/1.0 > > HTTP/1.1 200 OK > Content-Length: 6 > Date: Wed, 23 Jan 2019 19:31:37 GMT > Content-Type: text/html;charset=UTF-8 > Server: Unit/1.7 > > Connection closed by foreign host. > > when I was expecting "hello\n" to be sent as output. You see, Content-Length is correct, but no actual content. > > Alex > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -------------- next part -------------- An HTML attachment was scrubbed... URL: From tarkhil at over.ru Thu Jan 24 16:40:16 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Thu, 24 Jan 2019 19:40:16 +0300 Subject: unit, PSGI and Mojolicous In-Reply-To: <57653B04-F811-4812-9C6B-5F803F399135@nginx.com> References: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> <16474258.PnUtnXTaUz@vbart-workstation> <49210c83-74b2-fb1b-49aa-2c5acbe7540f@over.ru> <57653B04-F811-4812-9C6B-5F803F399135@nginx.com> Message-ID: <36379177-3f55-60b0-f9b1-38b64ef30cdd@over.ru> On 24.01.2019 19:13, Alexander Borisov wrote: > Hi ?????????, > > Please, try this patch for fix the problem: > # HG changeset patch > # User Alexander Borisov > > # Date 1548345939 -10800 > # Thu Jan 24 19:05:39 2019 +0300 > # Node ID a0a93e0673de88519bfd1062bdb6df166aa5ffa9 > # Parent dace60fc4926351efe9322761faf974b0ce7964a > Perl: fixed issue with body reading from response object. >>>> The smallest possible app, however, does not run >>>> >>>> === >>>> #!/usr/bin/env perl >>>> use Mojolicious::Lite; >>>> get '/' => sub { >>>> ?????my $c = shift; >>>> $c->render(text=>'hello'); >>>> }; >>>> >>>> app->start; >>>> === >>>> >>>> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to >>>> run Perl Application: >>>> Undefined subroutine &main::1 called. >>>> >>>> plackup runs it Ok, so there is some incompatibility, which I do not >>>> know how to trace. >>>> >>>> What kind of error in framework can it be and how to trace it? >>>> >>> [..] >>> >>> https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack >>> >>> Seems it doesn't behave like PSGI application by default, >>> unless there's a PLACK_ENV environment variable. >>> >>> Unit doesn't set PLACK_ENV by default. >> >> Sorry for doubleposting, but I've found one strange thing. >> >> root at VMNEW:~# telnet localhost 8000 >> Trying ::1... >> Trying 127.0.0.1... >> Connected to localhost. >> Escape character is '^]'. >> GET / HTTP/1.0 >> >> HTTP/1.1 200 OK >> Content-Length: 6 >> Date: Wed, 23 Jan 2019 19:31:37 GMT >> Content-Type: text/html;charset=UTF-8 >> Server: Unit/1.7 >> >> Connection closed by foreign host. >> >> when I was expecting "hello\n" to be sent as output. You see, >> Content-Length is correct, but no actual content. >> >> Alex >> >> _______________________________________________ >> unit mailing list >> unit at nginx.org >> https://mailman.nginx.org/mailman/listinfo/unit > > Cool, it nearly works. But looks like headers with underscore (yes I know that's wrong) are not passed to PSGI app Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From zelenkov at nginx.com Mon Jan 28 10:38:24 2019 From: zelenkov at nginx.com (Andrey Zelenkov) Date: Mon, 28 Jan 2019 13:38:24 +0300 Subject: unit, PSGI and Mojolicous In-Reply-To: <36379177-3f55-60b0-f9b1-38b64ef30cdd@over.ru> References: <8fff63cf-fa85-191f-3434-3700a7be230d@over.ru> <16474258.PnUtnXTaUz@vbart-workstation> <49210c83-74b2-fb1b-49aa-2c5acbe7540f@over.ru> <57653B04-F811-4812-9C6B-5F803F399135@nginx.com> <36379177-3f55-60b0-f9b1-38b64ef30cdd@over.ru> Message-ID: <94CC2218-5350-462D-9FA5-9C014867C856@nginx.com> > On 24 Jan 2019, at 19:40, ????????? ?????????? wrote: > > > > On 24.01.2019 19:13, Alexander Borisov wrote: >> Hi ?????????, >> >> Please, try this patch for fix the problem: >> # HG changeset patch >> # User Alexander Borisov >> # Date 1548345939 -10800 >> # Thu Jan 24 19:05:39 2019 +0300 >> # Node ID a0a93e0673de88519bfd1062bdb6df166aa5ffa9 >> # Parent dace60fc4926351efe9322761faf974b0ce7964a >> Perl: fixed issue with body reading from response object. >> >>>>> The smallest possible app, however, does not run >>>>> >>>>> === >>>>> #!/usr/bin/env perl >>>>> use Mojolicious::Lite; >>>>> get '/' => sub { >>>>> my $c = shift; >>>>> $c->render(text=>'hello'); >>>>> }; >>>>> >>>>> app->start; >>>>> === >>>>> >>>>> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to >>>>> run Perl Application: >>>>> Undefined subroutine &main::1 called. >>>>> >>>>> plackup runs it Ok, so there is some incompatibility, which I do not >>>>> know how to trace. >>>>> >>>>> What kind of error in framework can it be and how to trace it? >>>>> >>>> [..] >>>> >>>> https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack >>>> >>>> Seems it doesn't behave like PSGI application by default, >>>> unless there's a PLACK_ENV environment variable. >>>> >>>> Unit doesn't set PLACK_ENV by default. >>> >>> Sorry for doubleposting, but I've found one strange thing. >>> >>> root at VMNEW:~# telnet localhost 8000 >>> Trying ::1... >>> Trying 127.0.0.1... >>> Connected to localhost. >>> Escape character is '^]'. >>> GET / HTTP/1.0 >>> >>> HTTP/1.1 200 OK >>> Content-Length: 6 >>> Date: Wed, 23 Jan 2019 19:31:37 GMT >>> Content-Type: text/html;charset=UTF-8 >>> Server: Unit/1.7 >>> >>> Connection closed by foreign host. >>> >>> when I was expecting "hello\n" to be sent as output. You see, Content-Length is correct, but no actual content. >>> >>> Alex >>> >>> _______________________________________________ >>> unit mailing list >>> unit at nginx.org >>> https://mailman.nginx.org/mailman/listinfo/unit >> >> > Cool, it nearly works. But looks like headers with underscore (yes I know that's wrong) are not passed to PSGI app Hi Alex, I tried to send header with underscore and it looks like app have access to it. For the following request: === GET / HTTP/1.1 Host: localhost _X_-Foo-Bar_: _bl_ah_ Connection: close === I've got response: === HTTP/1.1 200 OK Content-Length: 7 Content-Type: text/html;charset=UTF-8 Date: Mon, 28 Jan 2019 10:23:30 GMT Server: Unit/1.8 Connection: close _bl_ah_ === And PSGI app that I used is: === use Mojolicious::Lite; get '/' => sub { my $c = shift; $c->render(text=>$c->req->headers->header('-X--Foo-Bar-')); }; === Could you please provide more information about how you try to use headers with underscore? -- Andrey Zelenkov From megatux at gmail.com Tue Jan 29 15:30:24 2019 From: megatux at gmail.com (megatux at gmail.com) Date: Tue, 29 Jan 2019 12:30:24 -0300 Subject: Ruby app with non-system Ruby Message-ID: Hi, I'm having trouble setting a new Ruby app. I'm unable to use a Ruby different than the system one. My idea is to have several rack web apps on different ports (or URIs if possible) but using a Ruby installation from a version manager, like rbenv, RVM, asdf. I have both Unit .deb installation and Docker installation. So, to make it simple, let's say I want 2 web apps, a Rails app and a Sinatra app, each one using a different Ruby installation within the "asdf" language version manager (it could be same user or not). Is it possible? Then, if the two apps are APIs, can I migrate _progressively_ different endpoints? Thanks a lot. -- ----------------------------------------------------- .^. In an open world, who needs windows or gates? /V\ Cristian Molina // \\ GNU/Linux User #73047, Ubuntu User # 14733 /( _ )\ Merlo, San Luis - Argentina ^^ ^^ --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Tue Jan 29 16:04:23 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 29 Jan 2019 19:04:23 +0300 Subject: Ruby app with non-system Ruby In-Reply-To: References: Message-ID: <16657084.atZSEzbBPS@vbart-workstation> On Tuesday 29 January 2019 12:30:24 megatux at gmail.com wrote: > Hi, > I'm having trouble setting a new Ruby app. I'm unable to use a Ruby > different than the system one. > > My idea is to have several rack web apps on different ports (or URIs if > possible) but using a Ruby installation from a version manager, like rbenv, > RVM, asdf. > > I have both Unit .deb installation and Docker installation. > > So, to make it simple, let's say I want 2 web apps, a Rails app and a > Sinatra app, each one using a different Ruby installation within the "asdf" > language version manager (it could be same user or not). Is it possible? > Then, if the two apps are APIs, can I migrate _progressively_ different > endpoints? > > Thanks a lot. > Because of perfomance reasons Unit doesn't use command-line interptreter directly from a version manager (that would be unallowable slow). In order to use Ruby from a version manager, you have to compile a Unit module with this particular Ruby interpreter. See here for details on compiling your own Ruby module from sources: http://unit.nginx.org/installation/#configuring-ruby Having modules of each version you will be able to switch between them via control API socket on a per application basis. See here for the "type" option details: http://unit.nginx.org/configuration/#application-objects wbr, Valentin V. Bartenev From megatux at gmail.com Tue Jan 29 19:07:55 2019 From: megatux at gmail.com (megatux at gmail.com) Date: Tue, 29 Jan 2019 16:07:55 -0300 Subject: Ruby app with non-system Ruby In-Reply-To: <16657084.atZSEzbBPS@vbart-workstation> References: <16657084.atZSEzbBPS@vbart-workstation> Message-ID: I see. That should work, thanks. Now, doesn't this compile-time list of available runtimes limit the "dynamic" nature of the service? e.g. I'm thinking in the common scenario of upgrading one of the runtimes because of a security update. This involves starting a new process and move all of its apps & listeners, right? El mar., 29 de ene. de 2019 a la(s) 13:04, Valentin V. Bartenev ( vbart at nginx.com) escribi?: > On Tuesday 29 January 2019 12:30:24 megatux at gmail.com wrote: > > Hi, > > I'm having trouble setting a new Ruby app. I'm unable to use a Ruby > > different than the system one. > > > > My idea is to have several rack web apps on different ports (or URIs if > > possible) but using a Ruby installation from a version manager, like > rbenv, > > RVM, asdf. > > > > I have both Unit .deb installation and Docker installation. > > > > So, to make it simple, let's say I want 2 web apps, a Rails app and a > > Sinatra app, each one using a different Ruby installation within the > "asdf" > > language version manager (it could be same user or not). Is it possible? > > Then, if the two apps are APIs, can I migrate _progressively_ different > > endpoints? > > > > Thanks a lot. > > > > Because of perfomance reasons Unit doesn't use command-line interptreter > directly from a version manager (that would be unallowable slow). > > In order to use Ruby from a version manager, you have to compile a Unit > module with this particular Ruby interpreter. > > See here for details on compiling your own Ruby module from sources: > http://unit.nginx.org/installation/#configuring-ruby > > Having modules of each version you will be able to switch between them > via control API socket on a per application basis. > > See here for the "type" option details: > http://unit.nginx.org/configuration/#application-objects > > wbr, Valentin V. Bartenev > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > -- ----------------------------------------------------- .^. In an open world, who needs windows or gates? /V\ Cristian Molina // \\ GNU/Linux User #73047, Ubuntu User # 14733 /( _ )\ Merlo, San Luis - Argentina ^^ ^^ --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Tue Jan 29 20:00:34 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 29 Jan 2019 23:00:34 +0300 Subject: Ruby app with non-system Ruby In-Reply-To: References: <16657084.atZSEzbBPS@vbart-workstation> Message-ID: <2538406.orMRJD62iI@vbart-workstation> On Tuesday 29 January 2019 16:07:55 megatux at gmail.com wrote: > I see. That should work, thanks. > Now, doesn't this compile-time list of available runtimes limit the > "dynamic" nature of the service? > e.g. I'm thinking in the common scenario of upgrading one of the runtimes > because of a security update. > This involves starting a new process and move all of its apps & listeners, > right? > [..] Unit has much more advanced architecture then most application servers. Unit contains an asynchronous router process, that deals with connections and doesn't deal with laguages. In order to run an application, another process is forked. Only after the fork, it loads a required application module in this new process. This application process then starts communication with the router process to serve requests and responses. So, the modules are loaded only inside the application processes that don't deal with client connections. When you have to update your application module because of security issue, you don't need to restart the whole Unit. This allows to handle this scenario gracefully with restarting only application processes without touching listening sockets and connections. Currently Unit scans modules directory only once in order to know what languages and versions are available. In future, it will be able to rescan this directory, and that will allow not only updating of existing modules, but also adding new languages and versions dynamically. wbr, Valentin V. Bartenev From megatux at gmail.com Tue Jan 29 20:37:25 2019 From: megatux at gmail.com (megatux at gmail.com) Date: Tue, 29 Jan 2019 17:37:25 -0300 Subject: Ruby app with non-system Ruby In-Reply-To: <2538406.orMRJD62iI@vbart-workstation> References: <16657084.atZSEzbBPS@vbart-workstation> <2538406.orMRJD62iI@vbart-workstation> Message-ID: Ah, cool. That makes total sense. Now I'm having issues trying to configure the ruby module with using my Ruby installation inside my local directory (using the "asdf" ruby plugin), but I will create a GitHub issue for this. (autoconf's ruby rbconfig looks ok to me) : $ ./configure ruby --module=ruby-2.6.0 --ruby=/home/megatux/.asdf/installs/ruby/2.6.0/bin/ruby configuring Ruby module checking for Ruby library ... not found checking for Ruby library in /home/megatux/.asdf/installs/ruby/2.6.0/lib ... not found ./configure: error: no Ruby found. Regards El mar., 29 de ene. de 2019 a la(s) 17:00, Valentin V. Bartenev ( vbart at nginx.com) escribi?: > On Tuesday 29 January 2019 16:07:55 megatux at gmail.com wrote: > > I see. That should work, thanks. > > Now, doesn't this compile-time list of available runtimes limit the > > "dynamic" nature of the service? > > e.g. I'm thinking in the common scenario of upgrading one of the runtimes > > because of a security update. > > This involves starting a new process and move all of its apps & > listeners, > > right? > > > [..] > > Unit has much more advanced architecture then most application servers. > > Unit contains an asynchronous router process, that deals with connections > and doesn't deal with laguages. In order to run an application, another > process is forked. Only after the fork, it loads a required application > module in this new process. This application process then starts > communication with the router process to serve requests and responses. > So, the modules are loaded only inside the application processes that > don't deal with client connections. > > When you have to update your application module because of security issue, > you don't need to restart the whole Unit. > > This allows to handle this scenario gracefully with restarting only > application processes without touching listening sockets and connections. > > Currently Unit scans modules directory only once in order to know > what languages and versions are available. In future, it will be able > to rescan this directory, and that will allow not only updating of > existing modules, but also adding new languages and versions dynamically. > > wbr, Valentin V. Bartenev > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > -- ----------------------------------------------------- .^. In an open world, who needs windows or gates? /V\ Cristian Molina // \\ GNU/Linux User #73047, Ubuntu User # 14733 /( _ )\ Merlo, San Luis - Argentina ^^ ^^ --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Wed Jan 30 11:54:48 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Wed, 30 Jan 2019 14:54:48 +0300 Subject: Ruby app with non-system Ruby In-Reply-To: References: <2538406.orMRJD62iI@vbart-workstation> Message-ID: <5457196.fQBZF3I1p6@vbart-workstation> On Tuesday 29 January 2019 17:37:25 megatux at gmail.com wrote: > Ah, cool. That makes total sense. > > Now I'm having issues trying to configure the ruby module with using my > Ruby installation inside my local directory (using the "asdf" ruby plugin), > but I will create a GitHub issue for this. (autoconf's ruby rbconfig looks > ok to me) : > > $ ./configure ruby --module=ruby-2.6.0 > --ruby=/home/megatux/.asdf/installs/ruby/2.6.0/bin/ruby > configuring Ruby module > checking for Ruby library ... not found > checking for Ruby library in /home/megatux/.asdf/installs/ruby/2.6.0/lib > ... not found > > ./configure: error: no Ruby found. > Could you provide "build/autoconf.err" with configure test results? wbr, Valentin V. Bartenev From megatux at gmail.com Wed Jan 30 17:23:57 2019 From: megatux at gmail.com (megatux at gmail.com) Date: Wed, 30 Jan 2019 14:23:57 -0300 Subject: Ruby app with non-system Ruby In-Reply-To: <5457196.fQBZF3I1p6@vbart-workstation> References: <2538406.orMRJD62iI@vbart-workstation> <5457196.fQBZF3I1p6@vbart-workstation> Message-ID: Sure thing. The same issue happens with 2.6.0 and 2.5.1 installations. The latest output on that file is: ---------- configuring Ruby module ... ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] ---------------------------------------- checking for Ruby library /usr/bin/ld: cannot find -lruby collect2: error: ld returned 1 exit status ---------- #include 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/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux -I/home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 -o build/autotest build/autotest.c -lruby -lpthread -ldl -lcrypt -lm ---------- ---------------------------------------- checking for Ruby library in /home/megatux/.asdf/installs/ruby/2.5.1/lib /usr/bin/ld: cannot find -lruby collect2: error: ld returned 1 exit status ---------- #include 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/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux -I/home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 -o build/autotest build/autotest.c -L/home/megatux/.asdf/installs/ruby/2.5.1/lib -Wl,-rpath,/home/megatux/.asdf/installs/ruby/2.5.1/lib -lruby -lpthread -ldl -lcrypt -lm ---------- -----------EOF------------------- Also, checking in the auto/modules/ruby file I see ruby calls to "rbconfig". This is the output I see: ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["libdir"])' /home/megatux/.asdf/installs/ruby/2.5.1/lib ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubyhdrdir"])' /home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubyarchhdrdir"])' /home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["RUBY_SO_NAME"])' ruby ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["LIBS"])' -lpthread -ldl -lcrypt -lm Thanks a lot El mi?., 30 de ene. de 2019 a la(s) 08:54, Valentin V. Bartenev ( vbart at nginx.com) escribi?: > On Tuesday 29 January 2019 17:37:25 megatux at gmail.com wrote: > > Ah, cool. That makes total sense. > > > > Now I'm having issues trying to configure the ruby module with using my > > Ruby installation inside my local directory (using the "asdf" ruby > plugin), > > but I will create a GitHub issue for this. (autoconf's ruby rbconfig > looks > > ok to me) : > > > > $ ./configure ruby --module=ruby-2.6.0 > > --ruby=/home/megatux/.asdf/installs/ruby/2.6.0/bin/ruby > > configuring Ruby module > > checking for Ruby library ... not found > > checking for Ruby library in /home/megatux/.asdf/installs/ruby/2.6.0/lib > > ... not found > > > > ./configure: error: no Ruby found. > > > > Could you provide "build/autoconf.err" with configure test results? > > wbr, Valentin V. Bartenev > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > -- ----------------------------------------------------- .^. In an open world, who needs windows or gates? /V\ Cristian Molina // \\ GNU/Linux User #73047, Ubuntu User # 14733 /( _ )\ Merlo, San Luis - Argentina ^^ ^^ --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Wed Jan 30 17:55:41 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Wed, 30 Jan 2019 20:55:41 +0300 Subject: Ruby app with non-system Ruby In-Reply-To: References: <5457196.fQBZF3I1p6@vbart-workstation> Message-ID: <5065171.CM8QVoFno4@vbart-workstation> Please show the content of lib directory: ls -l /home/megatux/.asdf/installs/ruby/2.5.1/lib wbr, Valentin V. Bartenev On Wednesday 30 January 2019 14:23:57 megatux at gmail.com wrote: > Sure thing. The same issue happens with 2.6.0 and 2.5.1 installations. The > latest output on that file is: > > > ---------- > configuring Ruby module ... > ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] > ---------------------------------------- > checking for Ruby library > /usr/bin/ld: cannot find -lruby > collect2: error: ld returned 1 exit status > ---------- > > #include > > 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/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux > -I/home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 -o > build/autotest build/autotest.c -lruby -lpthread -ldl -lcrypt -lm > ---------- > > > ---------------------------------------- > checking for Ruby library in /home/megatux/.asdf/installs/ruby/2.5.1/lib > /usr/bin/ld: cannot find -lruby > collect2: error: ld returned 1 exit status > ---------- > > #include > > 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/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux > -I/home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 -o > build/autotest build/autotest.c > -L/home/megatux/.asdf/installs/ruby/2.5.1/lib > -Wl,-rpath,/home/megatux/.asdf/installs/ruby/2.5.1/lib -lruby -lpthread > -ldl -lcrypt -lm > ---------- > > > > -----------EOF------------------- > Also, checking in the auto/modules/ruby file I see ruby calls to > "rbconfig". This is the output I see: > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["libdir"])' > /home/megatux/.asdf/installs/ruby/2.5.1/lib > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubyhdrdir"])' > /home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubyarchhdrdir"])' > /home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["RUBY_SO_NAME"])' > ruby > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["LIBS"])' > -lpthread -ldl -lcrypt -lm > > > Thanks a lot > > > > El mi?., 30 de ene. de 2019 a la(s) 08:54, Valentin V. Bartenev ( > vbart at nginx.com) escribi?: > > > On Tuesday 29 January 2019 17:37:25 megatux at gmail.com wrote: > > > Ah, cool. That makes total sense. > > > > > > Now I'm having issues trying to configure the ruby module with using my > > > Ruby installation inside my local directory (using the "asdf" ruby > > plugin), > > > but I will create a GitHub issue for this. (autoconf's ruby rbconfig > > looks > > > ok to me) : > > > > > > $ ./configure ruby --module=ruby-2.6.0 > > > --ruby=/home/megatux/.asdf/installs/ruby/2.6.0/bin/ruby > > > configuring Ruby module > > > checking for Ruby library ... not found > > > checking for Ruby library in /home/megatux/.asdf/installs/ruby/2.6.0/lib > > > ... not found > > > > > > ./configure: error: no Ruby found. > > > > > > > Could you provide "build/autoconf.err" with configure test results? > > > > wbr, Valentin V. Bartenev > > > > _______________________________________________ > > unit mailing list > > unit at nginx.org > > https://mailman.nginx.org/mailman/listinfo/unit > > > > > From megatux at gmail.com Wed Jan 30 19:59:28 2019 From: megatux at gmail.com (megatux at gmail.com) Date: Wed, 30 Jan 2019 16:59:28 -0300 Subject: Ruby app with non-system Ruby In-Reply-To: <5065171.CM8QVoFno4@vbart-workstation> References: <5457196.fQBZF3I1p6@vbart-workstation> <5065171.CM8QVoFno4@vbart-workstation> Message-ID: Pasted on this Gist: https://gist.github.com/megatux/b07eb0fe2820872e6b87c48a6df36a7d Regards El mi?., 30 de ene. de 2019 a la(s) 14:55, Valentin V. Bartenev ( vbart at nginx.com) escribi?: > Please show the content of lib directory: > > ls -l /home/megatux/.asdf/installs/ruby/2.5.1/lib > > wbr, Valentin V. Bartenev > > > On Wednesday 30 January 2019 14:23:57 megatux at gmail.com wrote: > > Sure thing. The same issue happens with 2.6.0 and 2.5.1 installations. > The > > latest output on that file is: > > > > > > ---------- > > configuring Ruby module ... > > ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] > > ---------------------------------------- > > checking for Ruby library > > /usr/bin/ld: cannot find -lruby > > collect2: error: ld returned 1 exit status > > ---------- > > > > #include > > > > 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/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux > > -I/home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 -o > > build/autotest build/autotest.c -lruby -lpthread -ldl -lcrypt -lm > > ---------- > > > > > > ---------------------------------------- > > checking for Ruby library in /home/megatux/.asdf/installs/ruby/2.5.1/lib > > /usr/bin/ld: cannot find -lruby > > collect2: error: ld returned 1 exit status > > ---------- > > > > #include > > > > 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/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux > > -I/home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 -o > > build/autotest build/autotest.c > > -L/home/megatux/.asdf/installs/ruby/2.5.1/lib > > -Wl,-rpath,/home/megatux/.asdf/installs/ruby/2.5.1/lib -lruby -lpthread > > -ldl -lcrypt -lm > > ---------- > > > > > > > > -----------EOF------------------- > > Also, checking in the auto/modules/ruby file I see ruby calls to > > "rbconfig". This is the output I see: > > > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["libdir"])' > > /home/megatux/.asdf/installs/ruby/2.5.1/lib > > > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubyhdrdir"])' > > /home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0 > > > > ~ $ ruby -r rbconfig -e > 'printf("%s",RbConfig::CONFIG["rubyarchhdrdir"])' > > /home/megatux/.asdf/installs/ruby/2.5.1/include/ruby-2.5.0/x86_64-linux > > > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["RUBY_SO_NAME"])' > > ruby > > > > ~ $ ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG["LIBS"])' > > -lpthread -ldl -lcrypt -lm > > > > > > Thanks a lot > > > > > > > > El mi?., 30 de ene. de 2019 a la(s) 08:54, Valentin V. Bartenev ( > > vbart at nginx.com) escribi?: > > > > > On Tuesday 29 January 2019 17:37:25 megatux at gmail.com wrote: > > > > Ah, cool. That makes total sense. > > > > > > > > Now I'm having issues trying to configure the ruby module with using > my > > > > Ruby installation inside my local directory (using the "asdf" ruby > > > plugin), > > > > but I will create a GitHub issue for this. (autoconf's ruby rbconfig > > > looks > > > > ok to me) : > > > > > > > > $ ./configure ruby --module=ruby-2.6.0 > > > > --ruby=/home/megatux/.asdf/installs/ruby/2.6.0/bin/ruby > > > > configuring Ruby module > > > > checking for Ruby library ... not found > > > > checking for Ruby library in > /home/megatux/.asdf/installs/ruby/2.6.0/lib > > > > ... not found > > > > > > > > ./configure: error: no Ruby found. > > > > > > > > > > Could you provide "build/autoconf.err" with configure test results? > > > > > > wbr, Valentin V. Bartenev > > > > > > _______________________________________________ > > > unit mailing list > > > unit at nginx.org > > > https://mailman.nginx.org/mailman/listinfo/unit > > > > > > > > > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > -- ----------------------------------------------------- .^. In an open world, who needs windows or gates? /V\ Cristian Molina // \\ GNU/Linux User #73047, Ubuntu User # 14733 /( _ )\ Merlo, San Luis - Argentina ^^ ^^ --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Wed Jan 30 20:59:31 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Wed, 30 Jan 2019 23:59:31 +0300 Subject: Ruby app with non-system Ruby In-Reply-To: References: <5065171.CM8QVoFno4@vbart-workstation> Message-ID: <1672944.RqgMAyPaZo@vbart-laptop> On Wednesday, 30 January 2019 22:59:28 MSK megatux at gmail.com wrote: > Pasted on this Gist: > https://gist.github.com/megatux/b07eb0fe2820872e6b87c48a6df36a7d > It seems there is no Ruby dynamic library (libruby.so), but only a static one (libruby-static.a). Unit currently is unable to build Ruby modules with static libraries. I'll consider it as a feature request. I suggest to look into "asdf" options (if any). Probably it can be configured to install dynamic Ruby library as well. wbr, Valentin V. Bartenev From vbart at nginx.com Wed Jan 30 21:15:27 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Thu, 31 Jan 2019 00:15:27 +0300 Subject: Ruby app with non-system Ruby In-Reply-To: <1672944.RqgMAyPaZo@vbart-laptop> References: <1672944.RqgMAyPaZo@vbart-laptop> Message-ID: <1870465.jsq5HPTNy0@vbart-laptop> On Wednesday, 30 January 2019 23:59:31 MSK Valentin V. Bartenev wrote: > On Wednesday, 30 January 2019 22:59:28 MSK megatux at gmail.com wrote: > > Pasted on this Gist: > > https://gist.github.com/megatux/b07eb0fe2820872e6b87c48a6df36a7d > > > > It seems there is no Ruby dynamic library (libruby.so), but only a > static one (libruby-static.a). > > Unit currently is unable to build Ruby modules with static libraries. > I'll consider it as a feature request. > > I suggest to look into "asdf" options (if any). Probably it can > be configured to install dynamic Ruby library as well. > Ruby build should be configured with "--enable-shared" flag. Please try setting: CONFIGURE_OPTS="--enable-shared" environment variable before running "asdf install". wbr, Valentin V. Bartenev From megatux at gmail.com Wed Jan 30 22:38:51 2019 From: megatux at gmail.com (megatux at gmail.com) Date: Wed, 30 Jan 2019 19:38:51 -0300 Subject: Ruby app with non-system Ruby In-Reply-To: <1870465.jsq5HPTNy0@vbart-laptop> References: <1672944.RqgMAyPaZo@vbart-laptop> <1870465.jsq5HPTNy0@vbart-laptop> Message-ID: Worked with CONFIGURE_OPTS="--enable-shared" asdf install ruby 2.5.3 It created the shared object library. Then I created the Unit module with ./configure ruby --module=ruby-2.5.3 --ruby=/home/megatux/.asdf/installs/ruby/2.5.3/bin/ruby $ ls -l build/ruby-2.5.3.unit.so -rwxr-xr-x 1 megatux megatux 271616 ene 30 19:12 build/ruby-2.5.3.unit.so* I'll continue with my tests later. Thanks a lot Valentin! El mi?., 30 de ene. de 2019 a la(s) 18:14, Valentin V. Bartenev ( vbart at nginx.com) escribi?: > On Wednesday, 30 January 2019 23:59:31 MSK Valentin V. Bartenev wrote: > > On Wednesday, 30 January 2019 22:59:28 MSK megatux at gmail.com wrote: > > > Pasted on this Gist: > > > https://gist.github.com/megatux/b07eb0fe2820872e6b87c48a6df36a7d > > > > > > > It seems there is no Ruby dynamic library (libruby.so), but only a > > static one (libruby-static.a). > > > > Unit currently is unable to build Ruby modules with static libraries. > > I'll consider it as a feature request. > > > > I suggest to look into "asdf" options (if any). Probably it can > > be configured to install dynamic Ruby library as well. > > > > Ruby build should be configured with "--enable-shared" flag. > > Please try setting: CONFIGURE_OPTS="--enable-shared" environment variable > before running "asdf install". > > wbr, Valentin V. Bartenev > > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > -- ----------------------------------------------------- .^. In an open world, who needs windows or gates? /V\ Cristian Molina // \\ GNU/Linux User #73047, Ubuntu User # 14733 /( _ )\ Merlo, San Luis - Argentina ^^ ^^ --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: