Hello Ruby on Rails world

There is a newer version of this article updated for Rails 3

To some people Rails have a fairly high learning curve. And certainly, it’s somewhat higher than, say, PHP. However, in the longer run learning Rails definitely pays off.

This is a step by step tutorial to getting over the first hurdle: Creating a “hello world” application in Ruby on Rails.

It works in Rails 1.0 assuming you have ruby and rails already installed and working on your system:

  1. rails hello
  2. cd hello
  3. ruby script\generate controller hello
  4. Create a file called index.rhtml in app/views/hello, containing “Hello world”.
  5. ruby script\server
  6. Navigate to http://localhost:3000/hello in your browser and be greeted with your friendly application: “Hello world”

PS: http://localhost:3000/ is a lot prettier “Hello world”-ish page.