So I am trying to generate a list of my numbers in a rage and export
that to a text file, wherein each number is written on it's own line. I
have no problem generating the array and writing it to file, I just
can't figure out how to make each value appear on it's own line.

Ex. I want this:
1
2
3
4

Ex. My output is this
1, 2, 3, 4

this is the section of my code that I am having problems with

while start_number < end_number do
  numberlist.push(start_number)
  start_number = start_number +1
  end

File.open(city_name, 'w' ) do |w|
  w.write(numberlist)
end

I have been searching online for a day and a half and I keep coming
across json and yaml. My understanding is that these gems provide an
intermediary standardized format that is acceptable by other languages,
and everything I am reading is about importing from .json or writing to
.json.

How could I just write to a .txt file in the format I have described?

Thanks

-- 
Posted via http://www.ruby-forum.com/.