in Rails

Using the standard output in script/breakpointer

When you use script/breakpointer, once you have stopped in irb, if you try using print, puts or some other way to display something, your ouput goes to your main rails output, not to irb, which is not quite convenient.

First, it took me a while to realize where the output was in fact going. I guessed I was not too quick on that one.

Second, even knowing where to look, I did not find this solution very satisfying.

It turns out there is a solution. the client variable can help you use the right output

client.print “hello\n”

will output:

hello
=> nil

Works the same for puts.