On Mar 17, 2011, at 23:06 , Shangz B. wrote:
> Hello and warm wishes to everyone who reads my post :)
>=20
> I am a newbie to Ruby (That Rhymes!). I am attempting to complete the
> "10 Minutes to YOur First Ruby Application" tutorial and I am stuck
> about the syntax of the example they are using. I get this error
> message:
It might be worth your time to check out Chris Pine's book "Learn to =
Program" just to get the basics of the syntax and semantics down first. =
http://pine.fm/LearnToProgram/ -- it is a really fast read and I've had =
people do it in a weekend, so it is good timing. :) You can go through =
the original tutorial at that url, or buy the current PDF from =
pragprog.com.
> "You must pass in the path to the file to launch.
>=20
> Usage: launcher.rb target_file"
You're getting that from the following:
> def help
> print "
> You must pass in the path to the file to launch.
>=20
> Usage: #{__FILE__} target_file
> "
> end
>=20
> if ARGV.empty?
> help
> exit
so, your ARGV.empty? evaluates to true, so you print help and exit. Pass =
in some args on the command line and you will be on to your next problem =
to fix, which Jesus pointed out.
One step at a time and you'll do fine. The Chris Pine book will do a =
good job of teaching you how all the different types of ruby variables =
work and how to get the syntax right. It should be a good suppliment to =
the thing you're currently reading.