104

真的,我不知道发生了什么。对不起,如果这个问题如此 NOOB,但我找不到这个问题的解决方案。

-bash:rvm:找不到命令

我试过这个

curl -L https://get.rvm.io | bash -s -- --version 最新

但我仍然不需要查看使用 simplecov 的 ruby​​ 版本,因为它不适用于 1.9 的旧版本

4

9 回答 9

243

这可能是因为终端没有加载 rvm shell 配置。

尝试从您的终端执行以下操作:

$ source ~/.rvm/scripts/rvm

然后

$ type rvm | head -n 1

如果输出是:

rvm is a function

您可能需要将“source ~/.rvm/scripts/rvm”添加到您的 ~/.bash_profile 文件中

于 2012-08-02T10:58:16.223 回答
53

您需要阅读安装 RVM 时显示的所有文本:

rm -rf ~/.rvm
curl -L https://get.rvm.io | bash -s stable
于 2012-07-27T21:33:05.637 回答
37

跑完之后sudo curl -L https://get.rvm.io | bash -s stable --ruby

您需要关闭终端,然后再次打开!

于 2014-11-06T07:14:24.283 回答
9

这对我有用:

rm -rf ~/.rvm
curl -L https://get.rvm.io | bash -s stable
于 2013-07-17T19:18:01.053 回答
5

source /etc/profile worked for me.

于 2017-11-01T12:31:30.090 回答
5

For a long-term solution, you should add this to your ~/.profile file:

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

to simply load rvm into a single terminal, use

source "$HOME/.rvm/scripts/rvm"

supposedly this call is more cross-platform:

. "$HOME/.rvm/scripts/rvm"
于 2018-02-21T20:33:03.473 回答
2

Close and restart terminal after installing RVM — gets me EVERY TIME.

于 2017-07-24T15:33:17.740 回答
1

To start using RVM, you'll need to enter source /Users/yourusername/.rvm/scripts/rvm into your terminal (of course, insert your real username in place of yourusername).

于 2016-05-03T00:44:54.683 回答
1

As suggested by @mpapis, Do this first

$ rm -rf ~/.rvm

$ curl -L https://get.rvm.io | bash -s stable

Then, as suggested by @peterpengnz, do this and you should be fine with RVM cmd issues

$ source ~/.rvm/scripts/rvm

于 2020-06-13T21:29:18.963 回答