为什么我会收到“无法识别的命令行参数”?使用“rvm use 1.9.2”?
我正在尝试在 Mac Mini 上使用 rvm
(Ruby 版本管理器)。但是,当我尝试时:
rvm install 1.9.2
我得到 ERROR: Unrecognized command line argument: 'install 1.9.2' ( see: 'rvm use' )
当我尝试时:
rvm use 1.9.2
我也得到 ERROR: Unrecognized command行参数:'use 1.9.2'(请参阅:'rvm use')
rvm use
不过工作正常。
有谁知道出了什么问题吗?我想我在另一个论坛中发现了一条消息,说我的 bash 可能已经过时,导致某些正则表达式可能被错误解析,但是 bash --version
说我的 bash 版本是 3.2.48( 1)-release
,与我的MacBook Pro上的版本相同,可以很好地运行rvm
。
更新:已解决(有点)——出于某种原因,我的 /usr/local/bin/rvm
版本为 1.10.2(最新),但却给了我所有这些错误。但是,如果我切换到 .rvm/bin/rvm(也是版本 1.10.2),一切都会正常...因此,任何能够解释原因的人都会得到赏金!
I'm trying to use rvm
(the Ruby version manager) on a Mac Mini. However, when I try:
rvm install 1.9.2
I get ERROR: Unrecognized command line argument: 'install 1.9.2' ( see: 'rvm usage' )
When I try:
rvm use 1.9.2
I also get ERROR: Unrecognized command line argument: 'use 1.9.2' ( see: 'rvm usage' )
rvm usage
works fine, though.
Anyone know what's wrong? I think I found a message in another forum that said my bash might be outdated, resulting in some regex being incorrectly parsed possibly, but bash --version
says my bash version is 3.2.48(1)-release
, which is the same version as on my MacBook Pro, which can run rvm
fine.
UPDATE: Solved (kind of) -- for some reason, my /usr/local/bin/rvm
is at version 1.10.2 (the latest) and yet gives me all these errors. But if I switch to .rvm/bin/rvm
, which is also at version 1.10.2, everything works fine... So bounty will be given to anyone who can explain why!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能安装了非常旧的
rvm
。最好的过程是使用RVM页面上的方法重新安装。它会不时发生变化,所以我不会将其粘贴在这里。我从未见过
bash
出现任何问题,因为操作系统通常具有相当最新的版本,并且rvm
在各种系统上运行。You might have a really old
rvm
installed. The best procedure is to re-install using the method on the RVM page. It changes from time to time so I'm not pasting it here.I've never seen any issues with
bash
as the OS usually has a reasonably up-to-date version andrvm
runs on a variety of systems.在安装 Ruby 之前,您可以先尝试使用此命令,以了解是否满足安装要求:
之后您可以运行安装命令:
引用我的来源: RVM 错误,要求安装失败,状态:1
You can try with this command first, before install Ruby in order to know if you meet installation requirements:
After that you can run the install command:
Quote my source: RVM error with Requirements installation failed with status:1