I added debugger
and require 'ruby-debug'
in my task to debug it.
When I run my task from the console, it does hit the debugger
, but doesn't let me inspect any variables. For example, if there's a line in my task :
my_var = 1 + 2
and I type my_var
or my_var.inspect
, while debugging, it says :
*** Unknown command: "my_var". Try "help".
What am I missing ?
Try to run
e my_var
If autoeval isn't set by default, you have to prefix any evaluation expression with e.
By the way, to set autoeval put the following line in ~/.rdebugrc
:
set autoeval
After you do that, any command which is not recognized by the debugger will be considered as an attempt to evaluate en expression so you could just type the variable name to get its value.