Is there a PHPish way of doing webpages with Ruby?

前端 未结 4 1683
予麋鹿
予麋鹿 2020-12-17 04:56

Is there a framework or something out there so that I can develop webpages in Ruby the same way I can as PHP. Something like

         


        
4条回答
  •  别那么骄傲
    2020-12-17 05:36

    You can, with https://github.com/migrs/rack-server-pages

    Instruction at that page.

    Summarizing:

    • gem install rack-server-pages

    • Create config.ru in the root folder of your "application":

      require 'rack-server-pages' run Rack::ServerPages

    • Create public/index.erb:

      Hello rack!

      <%= Time.now %>

    • execute rackup, your Ruby powered pages are ready to be served.

    • It also works with other application servers, for example, for passenger standalone, you just need to go to that folder and run passenger start.

提交回复
热议问题