views:

54

answers:

2

I have a long running rake task. Every now and then I print an update to the screen to let me know how far along the task has come.

puts "Almost there..."

My problem is all the puts statements seem to buffer somewhere and won't print to the screen until after the task is complete. At which point, they will be printed all at once.

Is there some way to force them to print as the task is running?

+1  A: 

May be you could flush the standart output:

STDOUT.flush

i-blis
+3  A: 
STDOUT.sync = true
kain