ghtn ghtn - 1 year ago 82
Ruby Question

How to suppress Rails console/irb outputs

I'm stuck with a pretty weird problem.

I was testing some db entries in our production server in Rails Console where almost all the commands were resulting a huge number of o/p lines, due to which the ssh channel was getting hanged :(

Is there a way to suppress the console/irb screenfuls?


Answer Source

You can append ; nil to all your your commands/statements.


users = User.all; nil

Actually irb prints the (return) value of the last executed statement. Thus in this case it'll print only nil as nil is the last executed valid statement :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download