Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX 10.9.4 ruby -version error

Not sure what happen do my ruby install

$ ruby -version ruby 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin13.3.0] -e:1: undefined local variable or method rsion' for main:Object (NameError)

like image 981
user2363318 Avatar asked Feb 10 '26 03:02

user2363318


1 Answers

You can string multiple parameters together when you run Ruby. In this case, -v is being interpreted as 'version' where as the 'e' is being interpreted as -e, which from the man page:

Specifies script from command-line while telling Ruby not to search the rest of the arguments for a script file name.

Ruby is then trying to parse the remainder ('rsion') as an argument to the -e. What you want it either:

ruby -v

or

ruby --version
like image 190
jbeck Avatar answered Feb 12 '26 21:02

jbeck