How can I develop a Web Application using ruby without rails

Discussion in 'Ruby' started by Pradeep Belagapu, Mar 25, 2008.

  1. 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
    --
    Posted via http://www.ruby-forum.com/.
     
    Pradeep Belagapu, Mar 25, 2008
    #1
    1. Advertising

  2. 2008/3/25, Pradeep Belagapu <>:
    > 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

    --
    use.inject do |as, often| as.you_can - without end
     
    Robert Klemme, Mar 25, 2008
    #2
    1. Advertising

  3. Pradeep Belagapu 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
     
    M. Edward (Ed) Borasky, Mar 25, 2008
    #3
  4. On Mar 25, 1:09 pm, Pradeep Belagapu <> 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
     
    Vidar Hokstad, Mar 25, 2008
    #4
  5. Pradeep Belagapu

    Zoltan Dezso Guest

    Pradeep Belagapu 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:
    <div>This is HTML</div>
    <% 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
    --
    Posted via http://www.ruby-forum.com/.
     
    Zoltan Dezso, Mar 25, 2008
    #5
  6. 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 Belagapu
    <> 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
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >




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

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

    Or, my blogs:
    http://mrneighborly.com
    http://rubyinpractice.com
     
    Jeremy McAnally, Mar 25, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tenxian
    Replies:
    7
    Views:
    317
    Arne Vajhøj
    Apr 22, 2008
  2. Michael Schuerig
    Replies:
    3
    Views:
    235
    Carl Youngblood
    Jun 17, 2005
  3. Replies:
    0
    Views:
    173
  4. Josef 'Jupp' SCHUGT
    Replies:
    5
    Views:
    188
    Stephan Kämper
    Jan 24, 2006
  5. Replies:
    0
    Views:
    108
Loading...

Share This Page