RVM 不切换红宝石 [英] RVM doesn't switch Rubies

查看:62
本文介绍了RVM 不切换红宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CentOS 上运行 Ruby 1.9.1p243,我决定安装 rvm 来处理升级到 1.9.2 或降级到 1.8.7(以更适合 rails3 的情况为准).

I'm running Ruby 1.9.1p243 on CentOS, and I decided to install rvm to handle upgrading to 1.9.2 or downgrading to 1.8.7 (whichever turns out to work better for rails3).

我按照此处的说明操作:http://rvm.beginrescueend.com/rvm/install/ 和一切安装正确.我能够编译和安装 Ruby 1.8.7、1.9.1 和 1.9.2.

I followed the instructions here: http://rvm.beginrescueend.com/rvm/install/ and everything installed correctly. I was able to compile and install Ruby 1.8.7, 1.9.1, and 1.9.2.

但是,如果我尝试实际切换到 rvm 安装的 Ruby 之一,例如使用 rvm 1.8.7,则没有任何效果.我的系统仍然使用我安装在/usr/local/bin/ruby 中的 Ruby.

However, if I try to actually switch to one of the rvm installed Rubies, with rvm use 1.8.7, for example, nothing works. My system still uses the Ruby I have installed in /usr/local/bin/ruby.

我得到的输出示例:

$ rvm use 1.8.7
$ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux]
$ which ruby
/usr/local/bin/ruby
$ rvm use 1.9.2
$ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux]
$ which ruby
/usr/local/bin/ruby

我不知道为什么会发生这种情况,而且我似乎也无法在网上找到有关此问题的任何信息.任何帮助将不胜感激.

I have no idea why this is happening, and I can't seem to find anything online about the issue either. Any help would be appreciated.

推荐答案

通常情况下,通过 IRC(freenode 上的#rvm)最容易支持 rvm - 在这种特殊情况下,运行type rvm | head -n1"会显示什么?它应该显示rvm 是一个函数".如果不是,这意味着源 rvm 的线路没有正确运行,因此切换不起作用.通常这意味着你要么在 ~/.bashrc 中返回了一个返回值,要么你错过了将这行添加到源 rvm 中.

Typically rvm support is easiest via IRC (#rvm on freenode) - in this particular case, what does running "type rvm | head -n1" show? it should show "rvm is a function". If not, that means the line to source rvm isn't being run correctly and hence switching doesn't work. Typically this means you either have a return in your ~/.bashrc or you missed adding the line to source rvm.

这篇关于RVM 不切换红宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆