我正在尝试将我的输出格式化为 json。这是来自http://www.sinatrarb.com/contrib/json.html的测试代码:
require "sinatra"
require "sinatra/json"
# define a route that uses the helper
get '/' do
  json :foo => 'bar'
end
# The rest of your classic application code goes here...
它向我显示“应用程序错误”。也许它来自其他文件来启动应用程序。我正在使用heroku(云)。所以我有一个 Gemfile :
source 'https://rubygems.org'
gem 'sinatra', '1.1.0'
gem 'thin'
Gemfile.lock :
GEM
  remote: https://rubygems.org/
  specs:
    daemons (1.1.9)
    eventmachine (1.0.3)
    rack (1.5.2)
    sinatra (1.1.0)
      rack (~> 1.1)
      tilt (~> 1.1)
    thin (1.5.1)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    tilt (1.4.1)
PLATFORMS
  ruby
DEPENDENCIES
  sinatra (= 1.1.0)
  thin
和 Procfile :
web: bundle exec ruby web.rb -p $PORT
我错过了什么 ?