Subscribe to How-To Geek

Installing Ruby on Rails on Ubuntu Dapper or Edgy

Ruby on Rails is a popular new framework for developing web applications. Since Ruby on Rails includes a built-in web server for development purposes, there is no need to install a separate web server.

First you will want to make sure that you've enabled the universe repository.

Open up a terminal window, and type in the following commands:

sudo apt-get install ruby ri rdoc
sudo wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
tar -xvzf rubygems-0.9.0.tgz
cd rubygems-0.9.0
sudo ruby setup.rb
sudo gem install rails –include-dependencies

To test out the installation, you can create a test rails project:

$ rails testapp

This will create a test application. Change directory into that directory and launch the Ruby on Rails development server (WEBrick)

$ ./script/server

Example:

/testapp$ ./script/server
=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with –help for options
[2006-12-07 05:28:37] INFO WEBrick 1.3.1
[2006-12-07 05:28:37] INFO ruby 1.8.4 (2005-12-24) [i486-linux]
[2006-12-07 05:28:37] INFO WEBrick::HTTPServer#start: pid=6687 port=3000

You'll notice that the server is listening on port 3000. Open up a browser, and go to http://localhost:3000

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 12/7/06 and tagged with: Ubuntu, Adding Software, Ruby on Rails

Comments (2)

  1. Piku

    You should always install the latest version of Gems (currently 1.0.1).

  2. SubbaRao

    Thanks, It helped.


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Sponsored Links
Getting Started
About How-To Geek
Popular Articles

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.