我得到“RVM 不是一个函数"Mac OS X 上的错误,并且没有发布的解决方案有效 [英] I'm getting "RVM is not a function" error on Mac OS X, and no posted solutions work

查看:29
本文介绍了我得到“RVM 不是一个函数"Mac OS X 上的错误,并且没有发布的解决方案有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Mac OS x 10.8.2(Mountain Lion"),并且我成功安装了 RVM 1.17.8 及其依赖项.我可以使用它来安装使用 rvm install 1.9.2 的 Ruby 版本,但我无法执行 rvm use 而不会出现此错误:

I'm on Mac OS x 10.8.2 ("Mountain Lion"), and I successfully installed RVM 1.17.8 and its dependencies. I'm able to use it to install Ruby versions using rvm install 1.9.2, but I can't execute rvm use <version> without getting this error:

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 运行:

I have the following in ~/.bash_profile, which I have set to run, using source ~/.bash_profile, whenever a terminal window is launched:

export SVN_EDITOR=vim
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[ -r ~/.bashrc ] && source ~/.bashrc

我试过运行 source ~/.rvm/scripts/rvm,它运行时没有返回错误,但是当我尝试使用时仍然收到RVM 不是函数"错误RVM 在终端会话中设置 Ruby 版本.

I've tried running source ~/.rvm/scripts/rvm, which runs without returning an error, but I still get the "RVM is not a function" error when I try to use RVM to set the Ruby version within the terminal session.

我还尝试使用 rvm implode 卸载和重新安装 RVM.我的想法已经用完了,我似乎无法在网上找到更多解决方案.帮助?

I also tried uninstalling and reinstalling RVM using rvm implode. I've run out of ideas and I can't seem to find any more solutions online. Help?

推荐答案

解决方案最终出现在 RVM Help &支持页面,在.bash_profile not being loaded on OSX"部分.似乎问题在于我将终端设置为使用默认登录shell"打开,当我将其更改为使用首选项/设置中的命令/usr/bash"打开时,源 ~/.rvm/scripts/rvm" 开始工作,现在 rvm 被识别为一个函数.

The solution ended up being on the RVM Help & Support page, in the ".bash_profile not being loaded on OSX" section. It seems that the issue was that I had my terminal set to open with the "default login shell" and when I changed it to instead open with the command "/usr/bash" in Preferences/Setup, "source ~/.rvm/scripts/rvm" started working, and rvm is now being recognized as a function.

这篇关于我得到“RVM 不是一个函数"Mac OS X 上的错误,并且没有发布的解决方案有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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