安装了哪个 ruby 版本?
听起来很奇怪,但我不知道安装了哪个 ruby 版本。如果我这样做,
rvm rubies
我会得到
ruby-1.9.2-p180 [ i686 ]
,但是
ruby -v
当我
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
尝试时,
rvm upgrade 1.8.7-p302 1.9.2-p180
我得到一个错误
ERROR: Ruby 'ruby-1.8.7-p302' is not installed - please install it first.
ERROR: Error migrating gems.
那么,它是哪一个? 1.8.7-p302 或 1.9.2-p180 ???
请帮帮我!谢谢
Sounds strange but I cannot tell which ruby version is installed. If I do
rvm rubies
I get
ruby-1.9.2-p180 [ i686 ]
but with
ruby -v
I get
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
When trying to
rvm upgrade 1.8.7-p302 1.9.2-p180
I get an error
ERROR: Ruby 'ruby-1.8.7-p302' is not installed - please install it first.
ERROR: Error migrating gems.
So, which one is it? 1.8.7-p302 or 1.9.2-p180 ???
Please help me out here! Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以从系统的已安装版本中获取
1.8.7
。使用rvm use --default 1.9.2
将通过rvm
安装的 Ruby 设置为默认值。RVM 基本上会更改您的
$PATH
变量,使其指向与系统上安装的版本不同的 Ruby 版本。另请确保您已完成安装指南的步骤 2 和 3,并确认 RVM 正确设置。
You get
1.8.7
from the installed version of your system. Uservm use --default 1.9.2
in order to set the Ruby installed viarvm
as default.RVM basically changes your
$PATH
variable to point to a different Ruby version than the one installed on your system.Please also make sure that you have done steps 2 and 3 of the installation guide and confirmed that RVM is correctly set up.
您可能拥有 1.8.7,因为您执行了 sudo apt-get install ruby 或类似操作,然后又运行了 rvm install 1.9.2。是这样吗?
You might have 1.8.7 because you did
sudo apt-get install ruby
or something like that, and then later ranrvm install 1.9.2
. Is that the case?答案正如其他发帖者所提到的。如果您选择使用 rvm 管理 ruby 版本,建议您卸载系统附带的 ruby 软件包。
The answer is both as mentioned by other posters. As a recommendation you should uninstall the ruby packages that come with the system if you choose to manage ruby version using rvm.