Last Updated: March 02, 2016
·
5.124K
· dcdieci

How to debug sidekiq workers in ruby with rubymine

I was facing several times the problem that I had to figure out what's happening inside a sidekiq worker, but at the repositories page there was just a statement that you have to use a logger.

That is very cumbersome since I can not inspect.
So I stumbled upon a question at stackoverflow where the question got rais, how to start sidekiq in rubymine "How to start sidekiq in RubyMine?" https://stackoverflow.com/questions/23467254/how-to-start-sidekiq-in-rubymine

I just followed the steps mentioned in the answer from @cavneb and this is the way how you can actually run the gem in debug mode of rubymine and inspect variables.

Just follow these steps:

Go to Run/Debug Configurations
Add a new Gem Command
Enter 'sidekiq' as the Gem name and Executable name
Check 'Run the script in the contexst of bundle (bundle exec) under the 'Bundler' tab
Click 'Apply' and then run it.

Thanks again to cavneb