Debug Gem Command
I have a gem project that I would like to debug. It can be executed via command line so I created a Run/Debug Configuration to be:
Gem Name: my_gem
Executable: my_gem
Arguments: help -c
Working Directory: <path to my gem project>
When I click debug it runs the command, but quickly exits and doesn't hit any of the breakpoints I put in my gem project. What am I doing wrong?
Please sign in to leave a comment.
Hi,
please enable verbose mode of ruby debugger (Settings|Build, Execution, Deployment|Debugger, Ruby section, "Verbose debugger output") and provide its output.
Regards, Oleg.
Fast Debugger (ruby-debug-ide 0.4.32, ruby-debug-base19x 0.11.31) listens on 127.0.0.1:62312
Connected from 127.0.0.1
78677: Starting control thread
78677: Processing in control: b /Users/peter/projects/devtools/lib/devtools/help_command.rb:123
78677: <breakpointAdded no="1" location="/Users/peter/projects/devtools/lib/devtools/help_command.rb:123"/>
78677: Processing in control: start
78677: Starting: running program script
I noticed that it requires that my gem be installed. I tried doing a "gem uninstall" from the command line before hitting the debug button and the Run/Debug Gem Command Config shows an error: "Gem Executable Not Found". So it seems it doesnt run my project it actually runs whatever gem is installed. So does that mean I can't debug my project which creates a Gem Command?
Hi,
does the command acually executed?
Is the location of the breakpoint actually correct?
Also have you verified that the line of breakpoint is executed?
Regards, Oleg.
P.S. I know the questions look dummy but since I do not have a test to play I have to verify everything :(
No problem.
1. Yup the command executes the breakpoint just doesn't get hit.
2. The location of the breakpoint is correct, but like I said it seems to execute the installed Gem not the one from my project. Which means I build the gem locally and install it locally via gem install -l <gem name>. When this is uninstalled it does not execute. Is the debug command supposed to execute my local project?
3. I've verified that its the correct line and that its supposed to hit there.
Hi,
I've just realized that you use gem command run configuration, but this configuration is supposed to run command of intalled gem.
In your case you need to use plain "ruby script" run configuration, and use your executable as ruby script.
Hope this helps, Oleg.
Got it figured out. Thanks for the help Oleg.