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?
Rake is a software task management and build automation tool created by Jim Weirich. It allows the user to specify tasks and describe dependencies as well as to group tasks in a namespace. It is similar in to SCons and Make.
Go to Websites & Domains and click Ruby. After gems installation you can try to run a Rake task by clicking Run rake task. In the opened dialog, you can provide some parameters and click OK - this will be equivalent to running the rake utility with the specified parameters in the command line.
If you meant exiting from a rake task without causing the "rake aborted!" message to be printed, then you can use either "abort" or "exit".
STDOUT.sync = true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With