我刚安装了RVM,但是不能让它工作。我在我的.profile文件的末尾有这样的一行:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

我试图运行源.profile和重新启动终端,但仍然,当我运行rvm使用1.9.2时,我得到:

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

我的系统是Ubuntu 11.10。


当前回答

最新的RVM (RVM 1.11.6(稳定))在Ubuntu上停止工作(10.10 - 64位-讨厌的小虫子或其他什么)-我一直在得到

“RVM不是一个函数,用RVM use选择红宝石…’是行不通的。”

之前,我得到了消息,但是'rvm 1.9.3-p0@rails321'可以工作。现在,它不起作用了——你根本不能改变gemset。

什么都不工作,直到我发现这个-把它作为/home/your-name/.bashrc的最后一行

[[-s "$HOME/。rvm/scripts/rvm"]] && source "$HOME/.rvm/scripts/rvm"

其他回答

在Mac OSX 10.8 Mountain Lion操作系统上安装Ruby 1.9.3-p125

You've already installed the latest XCode (>= 4.3) and and the command line Objective-C compiler "clang". You must run the "bash" shell for this procedure to work. Go to System Preferences Click on "Users & Groups" Click the lock on the bottom left of the panel and enter your password to unlock it. "Ctrl-Click" on your user icon in the left pane of the panel and choose "Advanced Options..." Change the Login Shell to "/bin/bash" Close the preferences Open a terminal window (press command+spacebar and type in "terminal") Follow the instructions at:

http://www.frederico-araujo.com/2011/07/30/installing-rails-on-os-x-lion-with-homebrew-rvm-and-mysql/

注:

要安装ruby,你可能需要指定clang编译器: $ RVM install 1.9.3p125——with-gcc=clang 如果RVM抱怨没有找到/usr/local/rvm,你需要创建一个链接: $ ln -s /Users/[用户名]/。rvm /usr/local/rvm

尽管你接受了一个答案,我还是想建议另一种方法。~ /。Bashrc在任何shell被打开之前被加载。在最后加上这一行,你不需要任何login shell的东西

我得到了同样的错误,因为我曾经用apt-get命令安装了旧的rvm版本ruby-rvm。

我通过删除在.bashrc文件中配置旧rvm的脚本行来解决这个问题。

检查旧的rvm config脚本,然后运行source .profile

我也犯了同样的错误,但这一页上的解决方案似乎都不起作用。对我来说,把rvm可执行文件添加到我的路径就足够了:

PATH=$PATH:/usr/local/rvm/bin/

和拖鞋!

也许你可以试试下面的方法:

你的终端-> 编辑- > 配置文件首选项-> 标题和命令-> . 检查“作为登录shell运行命令” 完成