First, go to rubyinstaller.rubyforge.org and select the
download link and get the stable release, 182-15.exe as of this writing.
Once the installer is downloaded, run it.
Of course you agree, don't we always?
Let's install everything.
I went with the default install path.
Click finish and now we have it.
Next, let's look at your install. Open a command prompt by
selecting Start | Run and type in CMD and select the OK button.
At the prompt type: ruby -v and hit Enter. You should
see that you now have version 1.8.2.
From here we can have a little fun. Type irb --simple-prompt
and let's start interactive Ruby with a simple prompt.
Instead of the usual Hello World app, we will expand our
horizons and do a Hello Solar System example here. At the prompt type the
following:
class SayIt
def Hey(planet)
return "Hey there, #{planet}."
end
end
You will then get a nil return as nothing will be returned
yet. Finally, invoke the class by typing the following at the prompt:
SayIt.new.Hey("Saturn")
You will then get the following returned: "Hey there,
Saturn." Here you created a class named SayIt with a method named Hey that
is passed a parameter and returns a string using that input parameter. See
below.
Next article, will get Rails working on Windows XP Pro.