I'm using sinatra-contrib 1.4.0, and #json method doesn't work properly, it throws this:
NameError - uninitialized constant MultiJson:
/Users/leafduo/.rvm/gems/ruby-2.0.0-p0/gems/sinatra-contrib-1.4.0/lib/sinatra/json.rb:125:in `block in <module:Sinatra>'
api.rb:6:in `block in <main>'
The document mentioned that I can replace a encoder, so I did that and wasted a long time...
As in ff66f80, sinatra/json started using multi_json, and dropped the ability to choose encoder, we should do require 'multi_json' in our code (rather than user's code) and clean up outdated document and code (like #resolve_encoder_action).
I can confirm this also.
Added dependencies to my gemspec:
gem.add_dependency "json", "~> 1.7.7"
gem.add_dependency "multi_json", "~> 1.7.3"
And added a required clause into my application. Thanks @leafduo for the workaround.
Fixed by #96