Reputation: 636
Is there a framework for Ruby for CGI that provides similar functionality as Ruby on Rails (mvc)?
Also, The server where the app shall be used on does not support FCGI, only plain old CGI.
Upvotes: 1
Views: 702
Reputation: 160631
Ruby comes with a CGI module, but it isn't a MVC at all. It makes it easy to extract parameters from a HTTP request passed to the app, encode and decode the query params, etc. It relies on a web server to handle routing the request to the right page, so there's quite a gap between a MVC and a CGI.
There are alternate MVCs for Ruby. Sinatra is very easy to use, and Padrino is built on Sinatra, putting it between Sinatra and Rails. I like using Sinatra at work because it's good for fast prototyping and in-house loads are nowhere close to what we'd get on an internet facing app.
As far as the server not supporting FCGI, a MVC doesn't really care. Put its server on a different port, then reference that port when you want something to talk to Sinatra. For instance, if you tell Sinatra to use 8088, your URLs for Sinatra served pages would be something like: http://host.com:8808/url/path/to/object
. Load your Sinatra based app on the web server and start it up. It'll run concurrently with the normal web server.
Upvotes: 2