I copied the following Ruby code from the Internet and made a few changes but it doesn't work.
What can I do to debug the program by myself?
I copied the following Ruby code from the Internet and made a few changes but it doesn't work.
What can I do to debug the program by myself?
If you are using RubyMine, debugging ruby scripts is simple and straightforward.
Suppose you have a Ruby script hello_world.rb
Set a breakpoint at line 6 as below.
Now you can just start the debugger to run the script:
Then when the execution hits a breakpoint, you'll be able to inspect variables, etc.