Linux

If you’re using Linux, you probably already have a favorite text editor, you know how to install Ruby with your package manager, and you better already know where to find your command line.

If you don’t have a text editor you’re fond of, though, might I recommend SciTE? It’s made specifically for programming, it plays well with Ruby, and it’s free. You can download it from http://www.scintilla.org/SciTE.html. If you use another relatively popular editor (emacs, vim, and so on), you can probably find Ruby syntax highlighting rules and such for it.

Next, you’ll want to see whether you have Ruby installed already. Type which ruby on your command line. If you see a scary-looking message that looks something like /usr/bin/which: no ruby in (...), then you’ll need to install it. Otherwise, see what version of Ruby you are running with ruby -v. If it is 1.8.7 or older, then you might want to upgrade.

If you’re using Ubuntu, you can use the Synaptic Package Manager to install or upgrade to the latest stable version of Ruby. You’ll find it in the Main menu in the System/Administration group. (On other Linux distributions you’ll want to use whatever is your default package manager, of course, but the general idea is the same.)

In Synaptic Package Manager, search for ruby. A bunch of Ruby-related packages will show up; find and install the package named simply ruby. That’s it.

Run one final ruby -v, just to make sure the gods are still smiling on you:

$​ruby -v
ruby 2.0.0p195 (2013-05-14) [i486-linux]

Perfect! Now all that’s left is to create a directory somewhere to keep your programs in, cd into that directory, and you’re all set!

All right! Are you ready? Take a deep breath. Let’s program!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.117.56