Search code examples
ruby-on-railsdebuggingrdebug

Rails Debug - How to print variable values on every step


Say I have a variable called @test_var

And I have hundred lines of code using this variable

On debugging I need to give n for next step and @test_var to check the value

Can I do both in single command (i.e) print the value of a variable on every step ?


Solution

  • You are looking for

    display @test_var
    

    After that, @test_var will be printed every time the debugger stops.