I\'m trying to understand the JSON serialization landscape in Ruby. I\'m new to Ruby.
Is there any good JSON serialization options if you are not working with Rails?
What version of Ruby are you using? ruby -v will tell you.
If it's 1.9.2, JSON is included in the standard library.
If you're on 1.8.something then do gem install json and it'll install. Then, in your code do:
require 'rubygems'
require 'json'
Then append to_json to an object and you're good to go:
asdf = {'a' => 'b'} #=> {"a"=>"b"}
asdf.to_json #=> "{"a":"b"}"