rails - Redirecting console output to a file

Posted by egarcia on Stack Overflow See other posts from Stack Overflow or by egarcia
Published on 2010-03-17T10:37:24Z Indexed on 2010/03/17 10:41 UTC
Read the original article Hit count: 260

Filed under:
|
|
|

On a bash console, if I do this:

cd mydir
ls -l > mydir.txt

The > operator captures the standard input and redirects it to a file; so I get the listing of files in mydir.txt instead of in the standard output.

Is there any way to do something similar on the rails console?

I've got a ruby statement that generates lots of prints (~8k lines) and I'd like to be able to see it completely, but the console only "remembers" the last 1024 lines or so. So I thought about redirecting to a file - If anyone knows a better option, I'm all ears.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about console