Ruby on the command line



$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

The -h flag will provide a list of all the command line options of Ruby.


$ ruby -h
...

Mostly we are going to create files in Ruby, but it is good to know that you can also create simple one-liners without creating a file.


$ ruby -e 'puts 19+23'
42