尝试了解如何在 Ebb Web 服务器上运行 Ruby (Sinatra) 应用程序
我需要编写一个超快速的 Ruby 应用程序来处理 Sinatra 上的 Web 请求 - 并希望在 Ebb Webserver。 但我不知道如何做到这一点。 有人可以帮我吗?
I need to write a super fast Ruby application to process web requests on Sinatra - and want to run it on the Ebb webserver. But I cannot work out how to do this. Could someone please help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
sinatra 有一个 -s 选项来指定处理程序。 尝试使用 -s ebb 运行您的应用程序。
sinatra has a -s option to specify a handler. try running your app with -s ebb.
您需要查看 Rack:http://rack.rubyforge.org/
这确实很简单,您有一个 .ru 文件,它指示 Rack 如何启动您的应用程序,并且在您的应用程序中,您有一个“调用”方法,该方法在每个请求上调用,并将响应发送回 Rack。
在 my_app.ru
在 my_app.rb
然后您在 sinatra 配置中指定 .ru 文件,例如:
You need to look at Rack: http://rack.rubyforge.org/
It's pretty easy really, you have a .ru file which instructs Rack how to start your application, and in your application you have a 'call' method which is called on each request, and sends the response back to Rack.
In my_app.ru
In my_app.rb
Then you specify the .ru file in your sinatra config, like: