JRuby – can’t convert Hash into String

I’ve recently upgraded a JRuby/Rails application from JRuby 1.6.3 (1.8 compatibility mode) to 1.6.8 (1.9 mode). Everything was working out fine except for actions relying on internal CSV library (FasterCSV in 1.8 mode). The error “ was thrown as CSV tries to generate the csv string.

This had the hallmarks that the application was still under the 1.8 mode (after a deploy to tomcat). The following XML entry in web.xml was essential to enforce the 1.9 mode:

{% highlight ruby %}

jruby.compat.version    1.9

{% endhighlight %}