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
eruby, mod_ruby (which I think, but unsure, is depreciated), cgi, fastcgi…
I can’t get the simple “hello world”
I’m with strong C# and PHP background
Add an HTTP background and you will be fine.
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:
puts “Content-Type: text/plain\n\n”,
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.