I am new to Ruby. My version is 2.0. I am running on Yosemite OSx.
What I am trying to do is a write a program in the text editor, save it
in .rb format, and run that program using the terminal on Mac.
I made a simple program …
puts “hello world”
and then saved it (to my desktop in a folder called ruby) as hello.rb
Now, I go into terminal and want to execute the “program”.
I have tried the following methods with no prevail…
$ ruby hello.rb <-- does not work…
It returns an error saying —> "’$’ is not allowed a global variable
name "
I’ve tried …
cd ~/
ruby hello.rb <----- did not work…
It returns no error, in fact it continues onto line 3 without noticing
reacting to what I typed.
PLEASE HELP. I am enjoying learning about Ruby so far, and am stuck at
this section of the book because of this problem!
Regards,
mac51894