Use workaround for http://luan-itworld.blogspot.de/2013/08/ruby-undefined-method-for.html
Use json_pure on older rubies if available.