是否有一种简单的方法可以直接将erb文件(如PHP文件)与NGINX一起使用?

问题描述:

有没有一种方法可以简单地将erb文件发送到ruby解析器,以获取答案并通过NGINX发送给客户端?没有所有乘客的东西?我猜应该很容易.我不想使用任何rails的东西,不要告诉我我应该使用rails等.

Is there a way to simply send a erb file to a ruby parser get the answer back and send it to client with NGINX? Without all the passenger stuff? It should be easy i guess. I DON'T want to use any rails stuff, don't tell me i should use rails etc.

两年前,我为此创建了一个脚本,名为类似的问题.我相信它确实符合您的要求.只需按照设置其他CGI/FastCGI处理程序的相同方式进行设置即可.

I created a script to do this two years ago, called ruby-cgi, in response to a similar question. I believe it does exacty what you want. Just set it up the same way you would set up other CGI/FastCGI handlers.