1. Computing

Ruby on Rails Tutorial - Starting the Blog

By

7 of 8

Start the Server

Start the Webrick server by running the script/server command from your blog directory. Once the server is started, you can start running actions and creating blog posts right away.

blog$ script/server
=> Booting WEBrick...
=> Rails 2.1.0 application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2008-07-02 09:58:55] INFO WEBrick 1.3.1
[2008-07-02 09:58:55] INFO ruby 1.8.6 (2007-09-24) [i486-linux]
[2008-07-02 09:58:55] INFO WEBrick::HTTPServer#start: pid=8231 port=3000

Open your web browser and go to http://localhost:3000/posts. You should see a rather blank page with the text Listing Posts, an empty table of the existing posts and a link named New Post. Click on the New Post link, fill out the form and hit the Create button. A new post has just been created and added to the database. All the work of creating forms and actions to create new posts has already been done for you by the scaffold generator.

  1. About.com
  2. Computing
  3. Ruby
  4. Ruby on Rails
  5. Start the Server

©2014 About.com. All rights reserved.