ruby debugger

# Step 1: Require the 'pry' gem at the beginning of your Ruby script or file.
require 'pry'

# Step 2: Place 'binding.pry' at the location in your code where you want to start debugging.
def example_method
  variable = 10
  binding.pry  # Execution will stop here, and you can inspect variables and control flow.

  # Step 3: Use 'continue' or 'c' in the debugger console to resume execution.
  variable += 5

  # Step 4: Use 'step' or 's' to execute the next line of code and enter methods.
  another_method(variable)
end

# Step 5: Define another method that you want to debug.
def another_method(value)
  result = value * 2
  puts result
end

# Step 6: Call the method to trigger the debugging session.
example_method

# Step 7: Run your Ruby script, and the debugger will start when it reaches the 'binding.pry' line.
# Step 8: Use various debugger commands like 'step', 'continue', 'break', 'list', etc., to navigate and inspect your code.
# Step 9: Exit the debugger session by typing 'exit' or 'quit'.