unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Stan Pitucha <stan.pitucha@envato.com>,
	Jeremy Evans <code@jeremyevans.net>
Cc: unicorn-public@bogomips.org
Subject: [PATCH] unicorn_rails: fix regression with Rails >= 3.x in app build
Date: Thu, 7 Mar 2019 02:28:59 +0000	[thread overview]
Message-ID: <20190307022859.mxz7m3mbspujo4c2@dcvr> (raw)
In-Reply-To: <CAJ2_uENSV6k7wgNLtRVtBEpOybzrO5+WQtWHzs4A5AMcYupNOw@mail.gmail.com>

Stan Pitucha <stan.pitucha@envato.com> wrote:
> That was indeed with `preload_app true`.
> 
> The patch you posted fixed the second issue and now both `unicorn` and
> `unicorn_rails` start successfully.

Thanks both.  Pushed out a pre-release with Jeremy's patch:

	gem install --pre unicorn 5.5.0.1.g6836

commit 6836d0674efdb1a6b79953285f10d8edd7e20432

Will tag and release 5.5.1 final in a day or two assuming all
goes well.
------8<-------
From: Jeremy Evans <code@jeremyevans.net>
Subject: [PATCH] unicorn_rails: fix regression with Rails >= 3.x in app build

Note: `unicorn_rails' was only intended for Rails <= 2.x projects
in the old days.

Fixes: 5985dd50a9bd7238 ("Support default_middleware configuration option")

From: Jeremy Evans <code@jeremyevans.net>
  cf. https://bogomips.org/unicorn-public/20190306055734.GC61406@jeremyevans.local/
Signed-off-by: Eric Wong <e@80x24.org>
  [ew: commit message]
---
 bin/unicorn_rails | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/unicorn_rails b/bin/unicorn_rails
index ea4f822..354c1df 100755
--- a/bin/unicorn_rails
+++ b/bin/unicorn_rails
@@ -132,11 +132,11 @@ def rails_builder(ru, op, daemonize)
 
   # this lambda won't run until after forking if preload_app is false
   # this runs after config file reloading
-  lambda do ||
+  lambda do |x, server|
     # Rails 3 includes a config.ru, use it if we find it after
     # working_directory is bound.
     ::File.exist?('config.ru') and
-      return Unicorn.builder('config.ru', op).call
+      return Unicorn.builder('config.ru', op).call(x, server)
 
     # Load Rails and (possibly) the private version of Rack it bundles.
     begin
-- 
EW

      reply	other threads:[~2019-03-07  2:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06  1:47 Issues after 5.5.0 upgrade Stan Pitucha
2019-03-06  2:48 ` Eric Wong
2019-03-06  4:07   ` Stan Pitucha
2019-03-06  4:44     ` Eric Wong
2019-03-06  5:57       ` Jeremy Evans
2019-03-06  7:27         ` Stan Pitucha
2019-03-07  2:28           ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307022859.mxz7m3mbspujo4c2@dcvr \
    --to=e@80x24.org \
    --cc=code@jeremyevans.net \
    --cc=stan.pitucha@envato.com \
    --cc=unicorn-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).