Ruby-on-rails 我收到 rvm:安装 rvm 后找不到命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13246429/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 20:59:33  来源:igfitidea点击:

I am getting rvm: command not found after installation of rvm

ruby-on-railsrubyrvmsproutcore

提问by Ramya

I know the above question is very common question. I have gone through multiple posts on this topic. But I didn't get any resolution.

我知道上面的问题是很常见的问题。我已经阅读了关于这个主题的多篇文章。但我没有得到任何解决。

I have installed rvm locally. We already have the installation files. SO went into the folder and run the install command.

我已经在本地安装了 rvm。我们已经有了安装文件。SO进入文件夹并运行安装命令。

$ ./install 

Then I checked ./rvm folder in the Users home folde

然后我检查了用户主文件夹中的 ./rvm 文件夹

$ cd ~/.rvm 

folder exists. Hence Installation is successful.

文件夹存在。因此安装成功。

Now I am typing rvm in the command line

现在我在命令行中输入 rvm

$ rvm

I am getting below exception

我低于异常

$ rvm
-sh: rvm: command not found

After reading the multiple articles in stackoverflow on this issue, I learned that I have to add the below lines in .bash_profile as I am using Mac OSX 10.7.3

在阅读 stackoverflow 中关于此问题的多篇文章后,我了解到我必须在 .bash_profile 中添加以下几行,因为我使用的是 Mac OSX 10.7.3

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

Even after I am getting same exception while typing rvm. Is there any thing extra I need to do? or Am I missing some thing? Please help

即使我在输入 rvm 时遇到相同的异常。有什么额外的我需要做的吗?或者我错过了什么?请帮忙

回答by RAM

Steps to try out:

试用步骤:

  1. Log out and login to your system.

  2. Open a new terminal and manually run

  1. 注销并登录到您的系统。

  2. 打开一个新终端并手动运行

source $HOME/.rvm/scripts/rvm

源 $HOME/.rvm/scripts/rvm

then

然后

rvm

房车

Check these work-arounds.

检查这些变通方法。

Update:

更新:

To avoid running

为了避免跑

source $HOME/.rvm/scripts/rvm

源 $HOME/.rvm/scripts/rvm

every time you open a terminal, include this line into ~/.MacOSX/environmentin your Mac (This is similar to ~/.bashrcin GNU/Linux-based systems under $homeaka ~directory).

每次打开终端时,将此行包含~/.MacOSX/environment在 Mac 中(这类似于~/.bashrc$homeaka~目录下的基于 GNU/Linux 的系统中)。

回答by daronwolff

In my case, i am using Ubuntu Bash in Windows 10 and to fix the problem i used:

就我而言,我在 Windows 10 中使用 Ubuntu Bash 并解决我使用的问题:

source /usr/local/rvm/scripts/rvm

回答by Daniel

For those that are doing this in 2018 just add

对于那些在 2018 年这样做的人,只需添加

source $HOME/.rvm/scripts/rvm 

to your .bash_profile within your home directory.

到您的主目录中的 .bash_profile。

回答by Hermann Klecker

I just had to open a new Terminal session.

我只需要打开一个新的终端会话。

After I installed it using:

我安装后使用:

curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm install 2.2

回答by mpapis

you need to enable login shell in terminal emulator preferences, sometimes it is needed to use /usr/bin/bash --login, here is an example https://rvm.io/integration/gnome-terminal/

您需要在终端模拟器首选项中启用登录 shell,有时需要使用/usr/bin/bash --login,这里是一个示例https://rvm.io/integration/gnome-terminal/

after enabling login shell you need to close terminal application and open it fresh.

启用登录外壳后,您需要关闭终端应用程序并重新打开它。

回答by RubyFanatic

For Ubuntu 18.04, I had to run the command below to solve the issue after rvmwas installed using instruction from here.

对于 Ubuntu 18.04,在使用此处的说明安装rvm后,我必须运行以下命令来解决问题。

source /usr/share/rvm/scripts/rvm