Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs

Partner Sites
JustLinux.com
Linux Planet
PHPBuilder
Technology Jobs

Top White Papers

  • This buyers guide provides independent research and test results to help you determine your endpoint protection requirements and identify the security...
    Download

  • A tiered archive allows dynamic control over how your data is accessed — ensuring the right data is available in the right place at the right time....
    Download

More on LinuxToday


Code Project: Create a web server in Ruby

Mar 24, 2009, 06:02 (0 Talkback[s])

"Setting up
First off, you'll need to install the Ruby interpreter, which should be in your package manager's repositories. You'll also want to install Irb, the interactive Ruby interpreter, which is supplied in a separate package in some distros.

"Once these things have been installed, fire up an interactive Ruby session by entering irb at a shell prompt. This will pop up a prompt for you to start entering Ruby statements. It's almost law that every coding guide starts with a Hello World instruction, but we'll bend the rules a little here. Run

puts "Goodbye moon!"

"That's pretty self-explanatory - puts outputs the supplied string to the screen. However, one of the most crucial features of Ruby to note is that everything is an object. Yes, even literal strings. It's pretty weird, but it enables you to do things like:"

Complete Story

Related Stories: