【发布时间】:2013-01-12 01:20:54
【问题描述】:
我使用的是 Mac OS x 10.8.2(“Mountain Lion”),并且成功安装了 RVM 1.17.8 及其依赖项。我可以使用它来安装使用rvm install 1.9.2 的Ruby 版本,但是我无法执行rvm use <version> 而不会出现此错误:
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
我在 ~/.bash_profile 中有以下内容,我设置为在终端窗口启动时使用 source ~/.bash_profile 运行:
export SVN_EDITOR=vim
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[ -r ~/.bashrc ] && source ~/.bashrc
我尝试运行source ~/.rvm/scripts/rvm,它运行时没有返回错误,但是当我尝试使用 RVM 在终端会话中设置 Ruby 版本时,我仍然收到“RVM 不是函数”错误。
我还尝试使用rvm implode 卸载和重新安装 RVM。我的想法已经用完了,我似乎无法在网上找到更多解决方案。帮忙?
【问题讨论】:
-
您是否阅读并尝试了 RVM Help & Support 页面上的建议?
-
我以为我已经尝试了所有发布的解决方案,但我在“.bash_profile 未在 OSX 上加载”部分下找到了一些东西,为我修复了它。似乎整个问题是我将终端设置为使用“默认登录 shell”打开,当我将其更改为使用 /usr/bash 打开时,上面的源 rvm 命令有效,而 rvm 现在被识别为一个函数。谢谢!!
-
天哪,感谢您发表此评论!这正是我在终端设置中的问题。
-
从终端中的 OS X 10.10 Yosemite 开始:首选项:常规:Shell 打开方式为:/bin/bash 为我工作。