Is there a simple way to use erb files directly like PHP files with NGINX?

萝らか妹 提交于 2019-12-22 08:52:25

问题


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.


回答1:


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.




回答2:


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

rack-server-pages

rhr




回答3:


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



来源:https://stackoverflow.com/questions/8481501/is-there-a-simple-way-to-use-erb-files-directly-like-php-files-with-nginx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!