Rackup通过Rack的默认处理程序成功运行任何Rack应用程序.例如:
class RackApp
def call(environment)
[
'200',
{'Content-Type' => 'text/html'},
["Hello world"]
]
end
end
run RackApp.new
Run Code Online (Sandbox Code Playgroud)
但是当最后一行被改为使用Rack的内置CGI处理程序时,rackup给出了"nil:NilClass的/ undefined方法`call'的NoMethodError":
Rack::Handler::CGI.run RackApp.new
Run Code Online (Sandbox Code Playgroud)
Rack的其他内置处理程序也提出了同样的异议.例如Rack :: Handler :: Thin,Rack :: Handler :: FastCGI,甚至Rack :: Handler :: WEBrick(这是Rack在默认模式下选择的处理程序).
这里的语法是什么?