Our setup includes the following:
- Ruby 1.9.1
- Rails 2.3.4
- Postgres 9
- Linux
When trying to output some UTF-8 data from the DB as CSV, Rails throws the following error:
ArgumentError (invalid byte sequence in US-ASCII):
haml (2.2.5) lib/sass/plugin/rails.rb:19:in `process'
<internal:prelude>:8:in `synchronize'
/usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
The same error occurs both when running through Webrick using script/server and through Passenger.
The funny part is that, on the almost same setup on my local machine, using the same database and the same request (so with the same data in the resultset), it doesn’t crash.
Any ideas?
Moving to Ruby 1.9.2 and Rails 2.3.14 indeed did solve the issue. Thanks to Frederick!