Directing command output to a view

Hi all,

Ive recently designed a system that is started from the command line.
ie.
/usr/local/bin/system.rb

The system is a long running task that outputs messages via “puts” to
the shell as its being executed.

I need to run this command from a rails application so that 1) it doesnt
block .ie user gets a “please wait” screen 2) and more importantly I
want the output of the command sent in real-time or near real-time to
the view, under the “please wait” message. And when the command exits,
the user is redirected to another view.

Any ideas whats the best way to do this?

Petr