Some time ago, I was supposed to debug a Foreman application using RubyMine and this task takes longer than I expected. So, I created this tutorial to help and show you the steps to start debugging.
1- Open Debug Configurations and select Gem Command.
2- Fill Gem name , Executable name and Arguments like the image below.
3- Choose Apply and OK, now you can start debugging.
Hope it helps !