From 2eb1944741be701d7cbf719ec3a87990ef7923a3 Mon Sep 17 00:00:00 2001 From: Bruce Krysiak Date: Wed, 16 Nov 2016 01:18:18 -0800 Subject: [PATCH] Prevent Rails 4 from setting env to test when running as resque-pool --- lib/resque/pool/cli.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/resque/pool/cli.rb b/lib/resque/pool/cli.rb index 63801c4..1ffb20c 100644 --- a/lib/resque/pool/cli.rb +++ b/lib/resque/pool/cli.rb @@ -172,7 +172,14 @@ def setup_environment(opts) def start_pool require 'rake' + self.const_set :RakeApp, Class.new(Rake::Application) { + def default_task_name # :nodoc: + "resque:pool" + end + } + Rake.application = RakeApp.new require 'resque/pool/tasks' + Rake.application.init Rake.application.load_rakefile Rake.application["resque:pool"].invoke