Or, you can write it from within Ruby:
open("out.json", "w") {|f| f.puts JSON.dump(showings) } open("out.json", "w") {|f| f.puts JSON.dump(showings) } f << JSON.dump(showings)
avoids adding any new lines (not that it really matters in the case of JSON)