Why can I not determine my ruby installation's version?

nameerror, ruby

Solution

Use either ruby -v or ruby --version. It's parsing the -version into rsion.

Either of these two work. Count the number of dashes:

ruby -v
ruby --version

When you provide a single dash with "version", Ruby sees this:

ruby -v -e rsion

Problem

When I run `ruby -version` I get: ``` ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] -e:1: undefined local variable or method `rsion' for main:Object (NameError) ``` What could be wrong?

Original source