Skip to content

Introduction to Ruby

MarkBennett edited this page Jan 12, 2012 · 7 revisions

Many people come to Ruby through Ruby on Rails. That's a great way to get started, but unless you understand the Ruby syntax it can seem like there's a lot of "magic" going on in your code. If you want to really understand what's happening you need to understand Ruby. It's not as hard as you might think and the Rails "magic" will start to make sense once you do.

If you haven't already you may want to install Ruby before you go any further.

Learning Ruby

There are lots of sites on the web that already teach you Ruby. Instead of making another one, we've tried to highlight some of the best.

If you're interested in learning Ruby quickly and without installing anything then tryruby.org is the place to start. In about 15 minutes it will guide you through using the interactive ruby console (irb), and some of the basic syntax.

New programmers should consider Learning to Program from the Pragmatic Bookshelf. It starts you off from the basics, and is written in Ruby.

When you're ready for something more advanced you can either turn to a book like The Well Grounded Rubyist, or the slightly unusual favourite Why's Poignant Guide. If you enjoy learning by doing then RubyKoans.org is a great resource that teaches you from the terminal.

Once you've got the basics covered I suggest heading to our Ruby resources page for some more advanced material. Questions are also always welcome on our mailing list and in the #yegrb IRC channel on Freenode. Remember to share an example of your code if you want a specific answer. You can use Github's Gists to share long code snippets.