How to suppress Rails console/irb outputs

ghtn picture ghtn · Jan 13, 2011 · Viewed 28.3k times · Source

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?

Thanks

Answer

intellidiot picture intellidiot · Jan 13, 2011

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

Example:

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 :)