OSDN Git Service

Check specifically for Unicorn in rack config.ru file
authorДамјан Георгиевски <gdamjan@gmail.com>
Thu, 23 Jan 2014 17:24:31 +0000 (18:24 +0100)
committerДамјан Георгиевски <gdamjan@gmail.com>
Thu, 23 Jan 2014 17:24:31 +0000 (18:24 +0100)
Don't assume that if the Rack server is not Passenger then it must be Unicorn. There are many other Rack servers in the world (uwsgi being one example that people use a lot).

The reverse check is much more logical, i.e. check explicitly for Unicorn

config.ru

index c45449d..e90863a 100644 (file)
--- a/config.ru
+++ b/config.ru
@@ -1,6 +1,6 @@
 # This file is used by Rack-based servers to start the application.
 
-unless defined?(PhusionPassenger)
+if defined?(Unicorn)
   require 'unicorn'
   # Unicorn self-process killer
   require 'unicorn/worker_killer'