The main source for all things Ruby is
http://www.ruby-lang.org/en/.
There are links there to documentation, installation instructions, and a
web page where you can try out
Ruby without installing it.
(But for CSE 413 you need to install Ruby locally and use irb
for Ruby interactions with source files as well as interactive coding.)
We are only using very basic Ruby features, so almost any version of Ruby 2.x or later should be adequate for our purposes. There have been changes in the Ruby languages and library over the years but we're hoping that we won't run into significant problems because of that.
ruby -v
in a terminal
window to see if it is, and ignore any warning messages that MacOS may not
include Ruby by default in future releases.
If you want to install a different version of Ruby there seem to be two reasonable
options for MacOS.
The easiest seems to be to install Homebrew,
which will also install the main MacOS developer tools
(something that you may well want to do even if you aren't using it to
install Ruby).
Then use Homebrew (brew install ruby
) to install the latest release of Ruby
and follow the optional instructions at the end of the installation
to add this version of Ruby to your terminal search path.
The other fairly reasonable (but somewhat harder to configure) option is to install
RVM, the classic Ruby package manager, and
configure versions from there.ruby --v
. You should see a message showing the version of Ruby
that is available. Also type the command irb
to verify that the
Ruby command-line interpreter is available.
Documentation: The Ruby documentation page has many good tutorials, manuals, and links to detailed infromation.
Reference material: See www.ruby-doc.org. You can also download copies of the reference pages to use when you're offline. We suggest you bookmark and use the reference pages for version 2.7.x or 3.0.x so you don't accidentally use newer libraries or Ruby features that might not be supported on the systems that we use to evaluate your code.
Books: The classic tutorial, including a basic class library reference, is Programming Ruby by Dave Thomas and colleagues. The first edition is available free online and covers most everything we need for CSE 413. More recent editions can be ordered through any bookstore, but you can also get electronic (pdf, ebook) versions as well as printed copies through the publisher's web site (Pragmatic Programmers).
Another good Ruby book is The Ruby Programming Language by David Flanagan and Yukihiro Matsumoto (the person who created Ruby). This can be accessed freely online by UW students through the O'Reilly Online website (use your @uw.edu email address to log on).
Let us know if you find other resources that would be good to add to this page. Post a note on the ed discussion board to let us know.