From 0632255f337d6978624a52e3197a79988b31aab0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 Mar 2009 11:53:03 -0800 Subject: require Rack as late as possible in execution This allows LOAD_PATH modifications via the command-line (via -I or -rubygems on the command-line). --- bin/unicorn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/unicorn b/bin/unicorn index 18edf43..de93985 100755 --- a/bin/unicorn +++ b/bin/unicorn @@ -1,7 +1,6 @@ #!/home/ew/bin/ruby $stdin.sync = $stdout.sync = $stderr.sync = true require 'unicorn' # require this first to populate Unicorn::DEFAULT_START_CTX -require 'rack' require 'optparse' env = "development" @@ -102,6 +101,10 @@ end require 'pp' if $DEBUG +# require Rack as late as possible in case $LOAD_PATH is modified +# in config.ru or command-line +require 'rack' + config = ARGV[0] || "config.ru" abort "configuration file #{config} not found" unless File.exist?(config) -- cgit v1.2.3-24-ge0c7