about summary refs log tree commit homepage
path: root/bin
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-02-24 15:35:42 -0800
committerEric Wong <normalperson@yhbt.net>2010-02-24 15:35:42 -0800
commit29661ccaaa03ab07f4de0d5c38f730f1d557b418 (patch)
tree9e9adbd02fd30f3182ca693d6797f2723b74b04a /bin
parente8344fbf3af94f96b3a6467d6ddad176935f0017 (diff)
downloadunicorn-29661ccaaa03ab07f4de0d5c38f730f1d557b418.tar.gz
The stock config/boot.rb file in a Rails 3 app is much lighter
and does not export any Rails/RAILS_* constants, so we'll wait
until we get config/environment.rb loaded.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/unicorn_rails8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/unicorn_rails b/bin/unicorn_rails
index b1458fc..8a7c21a 100755
--- a/bin/unicorn_rails
+++ b/bin/unicorn_rails
@@ -122,21 +122,19 @@ require 'pp' if $DEBUG
 
 # this won't run until after forking if preload_app is false
 app = lambda do ||
-  # Load Rails and the private version of Rack it bundles.
+  # Load Rails and (possibly) the private version of Rack it bundles.
   begin
     require 'config/boot'
   rescue LoadError => err
     abort "#$0 must be run inside RAILS_ROOT: #{err.inspect}"
   end
-  defined?(::RAILS_ROOT) or abort "RAILS_ROOT not defined by config/boot"
-  defined?(::RAILS_ENV) or abort "RAILS_ENV not defined by config/boot"
-  defined?(::Rails::VERSION::STRING) or
-    abort "Rails::VERSION::STRING not defined by config/boot"
 
   inner_app = case config
   when nil
     require 'config/environment'
 
+    defined?(::Rails::VERSION::STRING) or
+      abort "Rails::VERSION::STRING not defined by config/{boot,environment}"
     # it seems Rails >=2.2 support Rack, but only >=2.3 requires it
     old_rails = case ::Rails::VERSION::MAJOR
     when 0, 1 then true