Example: write text_area to a file where text_area is an array of strings. File.open('output.txt', 'w') { |f| text_area.each { |line| f << line } } Don't forget to do error checking on file operations :)