Web Ruby w/o Rails

Hi,

I want to start developing a web application in Ruby, but can't configure it
to work. There are so much options that I get confused :slight_smile:
eruby, mod_ruby (which I think, but unsure, is depreciated), cgi, fastcgi...

I can't get the simple "hello world" :frowning:

I'm with strong C# and PHP background, currently using PHP but hitting it's
limits for some time now, basically because of the lack of late static
binding.

I will be very grateful if you help me get started.

Regards,
Emil Ivanov

路路路

--
My place to share my ideas:
http://vladev.blogspot.com

Emil - what are you using as a web server? Platform? Configured to recognize and run ruby files? You said you can't get it to work, but what does that mean? What happens on the browser? What appears in the logs?

路路路

-----Original Message-----
From: "袝屑懈谢 袠胁邪薪芯胁 / Emil Ivanov" <emil.vladev@gmail.com>

Date: Sun, 24 Jun 2007 06:44:22
To:ruby-talk@ruby-lang.org (ruby-talk ML)
Subject: Web Ruby w/o Rails

Hi,

I want to start developing a web application in Ruby, but can't configure it
to work. There are so much options that I get confused :slight_smile:
eruby, mod_ruby (which I think, but unsure, is depreciated), cgi, fastcgi...

I can't get the simple "hello world" :frowning:

I'm with strong C# and PHP background, currently using PHP but hitting it's
limits for some time now, basically because of the lack of late static
binding.

I will be very grateful if you help me get started.

Regards,
Emil Ivanov
--
My place to share my ideas:
http://vladev.blogspot.com

Hey Emil,
聽聽If you think it might help and you're on windows I could send you my notes for setting up a web-based ruby-on-rails application. It uses lighttpd to serve it up and sqlite for the back end.
聽聽聽
聽聽Let me know if you want them, maybe they'll help you get started.
聽聽聽
聽聽- David

路路路

脨聲脨录脨赂脨禄 脨聵脨虏脨掳脨陆脨戮脨虏 / Emil Ivanov <emil.vladev@gmail.com> wrote:
聽聽Hi,

I want to start developing a web application in Ruby, but can't configure it
to work. There are so much options that I get confused :slight_smile:
eruby, mod_ruby (which I think, but unsure, is depreciated), cgi, fastcgi...

I can't get the simple "hello world" :frowning:

I'm with strong C# and PHP background, currently using PHP but hitting it's
limits for some time now, basically because of the lack of late static
binding.

I will be very grateful if you help me get started.

Regards,
Emil Ivanov
--
My place to share my ideas:
http://vladev.blogspot.com

---------------------------------
Shape Yahoo! in your own image. Join our Network Research Panel today!

Hi Emil,

Have you had a look at Camping: http://code.whytheluckystiff.net/camping/\. It looks pretty cool.

It has instructions for serving your app with lighttpd and apache.

Cheers,
Mark

袝屑懈谢 袠胁邪薪芯胁 / Emil Ivanov wrote:

路路路

Hi,

I want to start developing a web application in Ruby, but can't configure it
to work. There are so much options that I get confused :slight_smile:
eruby, mod_ruby (which I think, but unsure, is depreciated), cgi, fastcgi...

I can't get the simple "hello world" :frowning:

I'm with strong C# and PHP background, currently using PHP but hitting it's
limits for some time now, basically because of the lack of late static
binding.

I will be very grateful if you help me get started.

Regards,
Emil Ivanov

??? ??? / Emil Ivanov wrote:

Hi,

I want to start developing a web application in Ruby, but can't configure it
to work. There are so much options that I get confused :slight_smile:
eruby, mod_ruby (which I think, but unsure, is depreciated), cgi, fastcgi...

I can't get the simple "hello world" :frowning:

Take a look at Nitro.

Here's a Web "app" in a Ruby one-liner:

$ ruby -rubygems -e "require 'nitro'; class C; def index; print \
'Hello, world!';end;end; Nitro.start(C)"

Browse to 127.0.0.1:9000 to see the results.

How simple or complex you want your app to be is up to you.

See http://nitroproject.com/

路路路

--
James Britt

Thank you for responding so fast to all of you!

The platform is a Windows XP, Apache 2 and 2.2, MySQL 5 as a database.
(I must have been sleeping while I was writing the post...)

Note that I don't want any frameworks, although I will check the one you
suggested - I just want a simple hello world for now.
The fastcgi module is installed on the apache 2, but I don't know how to
configure it for ruby. I also want that erb to work, but i think I will
since it's written in ruby.

Regards,
Emil Ivanov

路路路

On 24/06/07, Mike Cahill <mike.cahill@comcast.net> wrote:

Emil - what are you using as a web server? Platform? Configured to
recognize and run ruby files? You said you can't get it to work, but what
does that mean? What happens on the browser? What appears in the logs?

--
My place to share my ideas:
http://vladev.blogspot.com

From: "袝屑懈谢 袠胁邪薪芯胁 / Emil Ivanov" <emil.vladev@gmail.com>

Date: Sun, 24 Jun 2007 06:44:22 To:ruby-talk@ruby-lang.org (ruby-talk ML)
Subject: Web Ruby w/o Rails

Hi,

I want to start developing a web application in Ruby, but can't configure it
to work. There are so much options that I get confused :slight_smile:
eruby, mod_ruby (which I think, but unsure, is depreciated), cgi, fastcgi...

I can't get the simple "hello world" :frowning:

I'm with strong C# and PHP background

[...]
Add an HTTP background and you will be fine. :slight_smile:

I will be very grateful if you help me get started.

We do not know what environment you are working
in and what your experience/knowledge is. So,
sorry if this answer is too basic or trivial.

The most common thing that is very likely to
be available on whatever web server you are using
might be CGI. Very likely that your web server has
a directory called cgi-bin. Ask your sysadmin or
- for Apache - check the httpd.conf to see details.

Assuming your web server has such a directory and
the execution of CGIs is enabled there (most often
the default setting), create a file in this directory,
name it 'test.rb' and put the following in this file:

#!/usr/local/bin/ruby
puts "Content-Type: text/plain\n\n",
      "Hello world"

Of course,this is a very basic way to work.
However, using the modules ERB and CGI it is even
possible to keep design and logic separated.

It doesn't work?
- chmod 755 test.rb
- Did you forget the two newlines after the Content-Type line?
- Ask the administrator if your web server configured to run CGIs.

HM

路路路

-----Original Message-----

Hi Emil,

If you want some examples of how to do this stuff from scratch, my RailsConf Europe presentation from last year is available at http://www.slideshare.net/feyeleanor/camping-going-off-the-rails-with-ruby\. A significant proportion of the text covers how to roll your own web application framework using WEBrick and the code examples should be sufficient for that purpose.

Ellie

Eleanor McHugh
Games With Brains

路路路

On 24 Jun 2007, at 09:16, 袝屑懈谢 袠胁邪薪芯胁 / Emil Ivanov wrote:

Thank you for responding so fast to all of you!

The platform is a Windows XP, Apache 2 and 2.2, MySQL 5 as a database.
(I must have been sleeping while I was writing the post...)

Note that I don't want any frameworks, although I will check the one you
suggested - I just want a simple hello world for now.
The fastcgi module is installed on the apache 2, but I don't know how to
configure it for ruby. I also want that erb to work, but i think I will
since it's written in ruby.

----
raise ArgumentError unless @reality.responds_to? :reason