diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb
index <HASH>..<HASH> 100644
--- a/lib/resque/worker.rb
+++ b/lib/resque/worker.rb
@@ -476,7 +476,7 @@ module Resque
     # Returns an array of string pids of all the other workers on this
     # machine. Useful when pruning dead workers on startup.
     def worker_pids
-      `ps -A -o pid,command | grep [r]esque | grep -v "resque-web"`.split("\n").map do |line|
+      `ps -A -o pid,command | grep resque | grep -v "resque-web"`.split("\n").map do |line|
         line.split(' ')[0]
       end
     end
diff --git a/test/worker_test.rb b/test/worker_test.rb
index <HASH>..<HASH> 100644
--- a/test/worker_test.rb
+++ b/test/worker_test.rb
@@ -267,6 +267,11 @@ context "Resque::Worker" do
     end
   end
 
+  test "worker_pids returns pids" do
+    known_workers = @worker.worker_pids
+    assert !known_workers.empty?
+  end
+
   test "Processed jobs count" do
     @worker.work(0)
     assert_equal 1, Resque.info[:processed]
Fix issue with finding worker pids on jruby

- Old pattern returned empty array of worker pids on jruby