Basic 'print' & 'puts' Mac OS terminal commands not found
print is not a standard bash command. I think so because  man print returns no manual entry. 
puts  is a Standard C Library function and should be used inside a file and used as:


#include &lt;stdio.h&gt;
puts(const char *s);

  
  The function puts() writes the string s, and a terminating newline character, to the stream stdout.


An example:


/* puts example : hello world! */
#include &lt;stdio.h&gt;

int main ()
{
  char string [] = "Hello world!";
  puts (string);
}


http://www.cplusplus.com/reference/cstdio/puts/


echo $path returns an empty line. It is case-sensitive. Use echo $PATH.
You need to save the ruby script in a file with appropriate file extension: .rb. Open Terminal, go the directory where the file is located using cd path/to/directory and run ruby filename.rb to see the results.