17 Comments »

Install or upgrade Ruby, RubyGems, Mongrel, Ruby on Rails, and MySQL with the required versions:

(Subject to revision up to the first lecture!)

  • Ruby 1.8.6 [1.8.5 is ok]
  • RubyGems 0.9.2 or later [0.9.0, 0.9.1 ok for Linux]
  • Ruby on Rails 1.2.3
  • Mongrel 1.0.1
  • MySQL 5.0.x
  • mysql gem 2.7.3 [2.7.x ok for Linux]

You may use any of the convenience installers you like (Windows One-Click Ruby Install, Instant Rails, Locomotive, etc.) as long as you end up with the correct versions and can execute the key programs (ruby, mysql, rails, irb, etc.). My personal preference is to install the “real” versions (rather than use, say, Instant Rails).

For links to the various installers, go to http://www.rubyonrails.com/down

On Windows, I think the easiest method is the Windows One-Click Ruby Install; since this comes with RubyGems, you can immediately install Ruby on Rails and Mongrel with gem. I’ve created a screencast of a full Windows install.

On Linux you use a combination of your system installer (aptitude, rpm, yast, etc.) and gem. There’s a screencast for Linux as well.

Then e-mail your section leader the following:

Subject line: Must include e168

Somewhere in the body of the e-mail: submission:assignment1

(1) the result of the following commands (case-sensitive):

ruby -v
gem -v
mongrel_rails --version
rails -v
irb -v
mysql -V
gem list mysql

Example output:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
0.9.2
Mongrel Web Server 1.0.1
Rails 1.2.3
irb 0.9.5(05/04/13)
mysql Ver 14.12 Distrib 5.0.41, for Win32 (ia32)
*** LOCAL GEMS ***
mysql (2.7.3)
A win32-native build of the MySQL API module for Ruby.

(2) A screenshot showing that Rails is working.

To do this, get a command prompt, and create a rails application named “assignment1″ with

rails  assignment1
cd assignment1

Now type:

ruby script/server
[Wait - server is loading . . . When you see "** Use CTRL-C to stop" . . .]

That starts the Mongrel server listening on Port 3000.

Now start your browser and browse to http://localhost:3000

When you see the “Welcome aboard” page, click on the link for “About your application’s environment”: The result should look like this (click for larger version):

Welcome Aboard screenshot

Once you have the screenshot, you can interrupt the Mongrel server by pressing control-C. Then you can remove the directory created by “rails assignment1″.

(3) Fun bonus (no extra points . . .):

What is the result of . . .

[NOTE: 26-Sep-2007: small change in quotation marks to support Bash 3. See comment below.]

ruby -e 'p "Uryyb, jbeyq!".tr("A-Za-z", "N-ZA-Mn-za-m")'

To sum up: A submission consists of three things: (1) a transcript or screenshot showing the versions of the installed software; (2) A screenshot of your browser showing the “Welcome aboard” page, along with the results of clicking “About your application’s environment”; (3) [optional] the answer to the fun bonus.

The e-mail subject line must include “E168″ and the body must have somewhere: submission:assignment1