如何在应用程序中包含 gemfile/required 时神奇地瘦 "take over"?

How does thin magically "take over" when included in the gemfile/required in the app?

我将 gem "thin"require 'thin' 添加到任何(看起来像)Rack 应用程序,当通过 rackup 启动应用程序时将自动选择它而不是 WEBrick。

rackup怎么知道用thin的?如果我使用 unicorn 或 Puma 或其他东西怎么办?

Rack's source code 州有三个默认服务器,顺序如下:Thin、Puma 和 WEBrick。

Rack 将尝试 'mount' 这三个服务器,除非设置了 PHP_FCGI_CHILDRENRACK_HANDLER 环境变量。

这种行为将来可能会改变,但目前只有 thin 和 puma 会在包含它们的宝石时自动识别。