# Saving data from the output window to a text file

**URL:** <https://www.ruby-forum.com/t/saving-data-from-the-output-window-to-a-text-file/155318>\
**Category:** Rails\
**Created:** [December 10, 2008, 3:45pm UTC](https://www.ruby-forum.com/t/saving-data-from-the-output-window-to-a-text-file/155318 "2008-12-10T15:45:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 10, 2008, 3:45pm UTC](https://www.ruby-forum.com/t/saving-data-from-the-output-window-to-a-text-file/155318/1 "2008-12-10T15:45:03Z")

</div>

Hi group,

I’m a complete novice who is having lots of fun discovering Ruby, Ruby  
on Rails / Watir. Good bits of software.

I wanted to record the info in the output window, into a text file. I  
wanted to do this in Ruby as I don’t know enough about R-o-R.

Can anyone help me out on this.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 10, 2008, 3:46pm UTC](https://www.ruby-forum.com/t/saving-data-from-the-output-window-to-a-text-file/155318/2 "2008-12-10T15:46:13Z")

</div>

On Dec 10, 1:07 pm, “removed\_email\_address@domain.invalid”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi group,
> 
> I’m a complete novice who is having lots of fun discovering Ruby, Ruby  
> on Rails / Watir. Good bits of software.
> 
> I wanted to record the info in the output window, into a text file. I  
> wanted to do this in Ruby as I don’t know enough about R-o-R.

as in the output you get when you run script/server ? It’s already  
being saved to log/development.log (or log/production.log when in the  
production environment etc…)

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 10, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/saving-data-from-the-output-window-to-a-text-file/155318/3 "2008-12-10T17:54:30Z")

</div>

Also, if you want whatever you spit out using puts

i.e puts array.inspect

then you can save to a text file by running mongrel in deamon mode

mongrel\_rails start -d

This will save all output in log/mongrel.log

On Dec 10, 1:07 pm, “removed\_email\_address@domain.invalid”
