p = Axlsx::Package.new
# ...
outstrio = StringIO.new
p.use_shared_strings = true # Otherwise strings don't display in iWork Numbers
outstrio.write(p.to_stream.read)
outstrio.string
This will yield the file contents of the xls file. Then you can either send_data
it to the user, or save it to a file on disk.