I am trying to use the axlsx gem to generate an Excel file. This is a Ruby Rails application where the user views a report in the browser and can click a link to export the data to Excel. However, I am getting the following error:
"ArgumentError (invalid byte sequence in UTF-8)."
This error is occurring on the following line of code:
p.to_stream.read.
I am using Ruby 1.9.3 and Rails 2.3.16. I am not serializing or trying to write the file to disk; I just want Excel to open the file and then the user can save the file if needed.
Has anyone ever seen this error?