CSE 341 Lecture Notes - Running Ruby

Ruby itself is designed to load and run files, but doesn't have an interface for interactive use. For interactive use, use 'irb' (Linux and Macintosh) or 'fxri' (Windows). You can start up interactive Ruby, and type expressions to be evaluated. Use the load function to load in a program file. Type control-d to exit.

The Lab has version 1.8.6 installed, and that will be the official version for 341 this quarter. The latest stable release is 1.9.1 -- that should be OK as well.

CSE Lab Machines - Windows

'fxri' lives under All Programs > DEV TOOLS&LANGUAGES > Ruby-186-27 > fxri. This includes an integrated documentation browser. There is also other documentation under Ruby-186-26.

CSE Lab Machines - Linux

Type 'irb' at the prompt to get Interactive Ruby. Type 'ruby yourfilename.rb' to run Ruby on a program file.

Personal Machines

You may already have Ruby on your machine -- for example, version 1.8.7 comes bundled with Leopard on the Macintosh. Otherwise you can download Ruby for various platforms from the Ruby home page. It's free.