Introduction to Ruby

Taught by Alex Chaffee

these slides are available at

Test-First Teaching

  • We use tests to check for code correctness
  • We use tests to define the task to implement
  • We know we're done when the tests pass

Conceived by Sarah Allen and Alex Chaffee

Let's get started

Install Ruby, e.g.

then open a terminal window and type this:

git clone

cd learn_ruby

then open index.html in a browser

Very Important Tips!

Arrange Your Windows

  • Keep your console window open
  • Make your console window REALLY TALL
  • Don't overlap your windows


  • This is actually very difficult to do consistently and accurately
  • When you get an error, SCROLL UP and read down STARTING from where YOU HIT RETURN
  • It's not all incomprehensible gibberish -- the computer is trying to tell you something, and it's your job to decipher it