How to get PID of current rake task? March 29, 2023 by Tarik You get the current PID in Ruby with Process.pid