about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-03-05 21:57:34 -0800
committerEric Wong <e@80x24.org>2019-03-06 22:11:19 +0000
commit6836d0674efdb1a6b79953285f10d8edd7e20432 (patch)
tree48de67abb8154eb82914260cca9fe1470d549cdf
parentc6ab1f479bb36bb0c0e68f375e0ce21533a65ba5 (diff)
downloadunicorn-6836d0674efdb1a6b79953285f10d8edd7e20432.tar.gz
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]
-rwxr-xr-xbin/unicorn_rails4
1 files 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