LOGO

Install Ruby on Rails on Ubuntu Dapper/Edgy

December 7, 2006
Install Ruby on Rails on Ubuntu Dapper/Edgy

Installing Ruby on Rails

Ruby on Rails is a widely-used framework designed for building web applications. A key benefit is its integrated development web server, eliminating the need for separate server installation.

Initial Setup

Before proceeding, ensure the universe repository is enabled on your system. This is a prerequisite for successful installation.

Open a terminal window and execute the following commands sequentially:

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

Verifying the Installation

To confirm that Ruby on Rails has been installed correctly, a test project can be created.

Use the following command in your terminal:

$ rails testapp

This command will generate a new test application directory.

Launching the Development Server

Navigate into the newly created test application directory. Then, initiate the Ruby on Rails development server, known as WEBrick.

$ ./script/server

The server startup process will display output similar to this:

/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

Accessing the Test Application

Observe that the server is actively listening on port 3000. To view the test application, open a web browser and enter the address http://localhost:3000.

#Ruby on Rails#Ubuntu#Dapper#Edgy#installation#tutorial