Covered in this episode:
- Installing Ruby
- What you will need
- Hello World! program
Hello everybody and welcome to Programming with Ruby Episode 2 – Getting Started. I’m the presenter, as always, Tyler. This is brought to you by manwithcode.com.
This is ruby-lang.org. Go to the downloads section. There are a bunch of links here. If you are on Windows, go to the Ruby One-Click Installer. It is a standard installer, like any other Windows program.
If you are on a Debian variant of Linux (such as Ubuntu). The line:
sudo apt-get install ruby irb rdoc
will get you what you need
If you are on mac OSX, you can install ruby with mac ports via the command:
port install ruby
alternatively you can go to the ruby OSX one click installer (http://rubyosx.rubyforge.org/), be sure to the installer for version 1.8.7 not 1.9.1
If you are compiling from source, compile 1.8.7 NOT 1.9.1
To get started you will need a text editor, like Notepad. It needs to be plain text editor, we don’t want any of the formatting that programs like Word put on there.
My editor of choice is gEdit, which comes with the GNOME desktop on Linux.
Alternatively you can use an IDE, like Netbeans or Geany.
Open up your text editor, and type in:
puts "Hello World!"
save that to your desktop as hello.rb
There are two ways of running this. If you are on Windows, go to where you saved it and double click on it.
Or you can open up the Command Prompt/Terminal. Change directories to where you saved the files and type in:
Questions or Comments
Leave a comment on this page
or email me at firstname.lastname@example.org