Is there a simple way to use erb files directly li

2019-05-06 12:48发布

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.

3条回答
Rolldiameter
2楼-- · 2019-05-06 13:13

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.

查看更多
劫难
3楼-- · 2019-05-06 13:19

The following gems are available (sorted by feature completeness desc):

rack-server-pages

rhr

查看更多
劳资没心,怎么记你
4楼-- · 2019-05-06 13:22

Of course you can, try this. But I would highly recommend using Sinatra as it's more like a ruby way of serving web pages like in php

查看更多
登录 后发表回答