How can I develop a Web Application using ruby without rails

I have an idea about developing web application using Ruby on Rails.
But I don’t know how to develop a web application using only ruby
without rails. Is it possible? If possible how can I handle requests,
actions, responses etc., Please clear my doubt as early as possible.

Thanks

Pradeep Kumar

2008/3/25, Pradeep B. [email protected]:

I have an idea about developing web application using Ruby on Rails.
But I don’t know how to develop a web application using only ruby
without rails. Is it possible? If possible how can I handle requests,
actions, responses etc., Please clear my doubt as early as possible.

You can use CGI and there is a class with the same name that helps you
process requests and create responses.

Then there are various other mechanisms like FastCGI etc.

Kind regards

robert

Pradeep B. wrote:

I have an idea about developing web application using Ruby on Rails.
But I don’t know how to develop a web application using only ruby
without rails. Is it possible? If possible how can I handle requests,
actions, responses etc., Please clear my doubt as early as possible.

Thanks

Pradeep Kumar

Iowa … Nitro … roll your own

On Mar 25, 1:09 pm, Pradeep B. [email protected] wrote:

I have an idea about developing web application using Ruby on Rails.
But I don’t know how to develop a web application using only ruby
without rails. Is it possible? If possible how can I handle requests,
actions, responses etc., Please clear my doubt as early as possible.

Look at Rack: http://rack.rubyforge.org/

It gives you a thin web-server independent layer that also tie in
nicely with a large number of frameworks, and at the same time is
simple enough that you can trivially write an application without a
framework if you prefer. The code I run my site and my blog on at
http://www.hokstad.com/ is built using only Rack and no framework,
combined with various self contained libraries, for example so it’s
absolutely doable.

Vidar

Take look at my framework named vintage (it’s on Rubyforge). That
uses Rack to create a rather barebones web framework. It’d probably
be a good starting point to learn from or use directly.

–Jeremy

On Tue, Mar 25, 2008 at 9:09 AM, Pradeep B.
[email protected] wrote:

Posted via http://www.ruby-forum.com/.


http://jeremymcanally.com/
http://entp.com

Read my books:
Ruby in Practice (Ruby in Practice)
My free Ruby e-book (http://humblelittlerubybook.com/)

Or, my blogs:

http://rubyinpractice.com

Pradeep B. wrote:

I have an idea about developing web application using Ruby on Rails.
But I don’t know how to develop a web application using only ruby
without rails. Is it possible? If possible how can I handle requests,
actions, responses etc., Please clear my doubt as early as possible.

Thanks

Pradeep Kumar

Hi,

I am currently developing Ruby (not rails) web applications for mobile
phones - so yes, you don’t need rails.

To get some basic information about the cgi version, i recommend
starting here:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/web.html

You can get information about eruby and mod_ruby (for apache) from this
site:
http://modruby.org/en/

These are not frameworks, they just execute ruby code. If you are using
apache, it is fairly straightforward to set up the eruby executable to
handle your requests for you and you just basically embed ruby inside
html like this:

This is HTML
<% print "this is ruby" %> etc. A tutorial can be found here: http://www.hiveminds.co.uk/node/3094

With mod_ruby or fastcgi, you can get even more control over the
response, you can create a small ruby program that catches the request
and generates the whole response.

print “HTTP/1.1 200 OK\n”
print “Content-Type: text/plain\n\n”
print ‘Static text.’

is a very simple handler that just displays that static text. Of course,
as Robert mentioned before, you can use CGI to help you, like:
require ‘cgi’
c = CGI.new
print c.header(‘type’=>‘text/plain’)
print ‘Static text.’

Hope this helps.

Zaki

Try merb.

   http://merbivore.com/

Also, here is an article that goes over 10 other ruby web frameworks
besides rails.

10 Alternative Ruby Web Frameworks | Accidental Technologist (old)

Zoltan D. [email protected] wrote:
Pradeep B. wrote:

I have an idea about developing web application using Ruby on Rails.
But I don’t know how to develop a web application using only ruby
without rails. Is it possible? If possible how can I handle requests,
actions, responses etc., Please clear my doubt as early as possible.

Thanks

Pradeep Kumar

Hi,

I am currently developing Ruby (not rails) web applications for mobile
phones - so yes, you don’t need rails.

To get some basic information about the cgi version, i recommend
starting here:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/web.html

You can get information about eruby and mod_ruby (for apache) from this
site:
http://modruby.org/en/

These are not frameworks, they just execute ruby code. If you are using
apache, it is fairly straightforward to set up the eruby executable to
handle your requests for you and you just basically embed ruby inside
html like this:
This is HTML

etc.
A tutorial can be found here: http://www.hiveminds.co.uk/node/3094

With mod_ruby or fastcgi, you can get even more control over the
response, you can create a small ruby program that catches the request
and generates the whole response.

print “HTTP/1.1 200 OK\n”
print “Content-Type: text/plain\n\n”
print ‘Static text.’

is a very simple handler that just displays that static text. Of course,
as Robert mentioned before, you can use CGI to help you, like:
require ‘cgi’
c = CGI.new
print c.header(‘type’=>‘text/plain’)
print ‘Static text.’

Hope this helps.

Zaki

Posted via http://www.ruby-forum.com/.