简体   繁体   中英

OSX 10.9.4 ruby -version error

不确定我的ruby安装会发生什么

$ 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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM