Edit program to print something, then rerun the program:
puts "something"
Use debugging program to investigate or alter the internal state of a running program:
binding.irb
binding.pry
dtrace / dtruss a running program.1
sudo dtruss bundle install