Ruby-on-rails 安装 rvm "bash /root/.rvm/scripts/rvm 没有那个文件或目录"

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22747258/
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 23:29:32  来源:igfitidea点击:

install rvm "bash /root/.rvm/scripts/rvm No such file or directory"

ruby-on-railsruby

提问by Harman

I want to install RVM in ubuntu and I am following these steps

我想在 ubuntu 中安装 RVM,我正在按照以下步骤操作

root@jaskaran-Vostro-1550:/home/user_name# sudo apt-get install curl

done this successfully

成功地做到了这一点

root@jaskaran-Vostro-1550:/home/user_name# curl -L https://get.rvm.io | bash -s stable

done this successfully

成功地做到了这一点

but when I run this command

但是当我运行这个命令时

root@jaskaran-Vostro-1550:/home/user_name# source ~/.rvm/scripts/rvm

result like that

结果那样

bash: /root/.rvm/scripts/rvm: No such file or directory

What's wrong in this?

这有什么问题?

回答by gobeltri

I was installing RVM on a remote server today and had the same issue. It seems that the installation was not executed by default. This is what I did to solve it:

我今天在远程服务器上安装 RVM 并遇到了同样的问题。似乎默认情况下没有执行安装。这是我为解决它所做的:

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

  # In case rvm not found
  cd ~/.rvm/archives
  tar xvzf rvm-1.26.0.tgz # or whatever RVM version you have
  cd mpapis-rvm-xxxxxxx
  ./install
  cd ..
  rm -Rf mpapis-rvm-xxxxxxxx

source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc

回答by Nick Veys

Try looking in /usr/local/rvminstead. You're root, it installs differently as root.

试着往里看/usr/local/rvm。您是 root,它的安装方式与 root 不同。

Are you sure you want to install RVM as root? It's typically a user thing.

您确定要以 root 身份安装 RVM 吗?这通常是用户的事情。

回答by omikes

If you installed rvm from root, try:

如果您从 root 安装了 rvm,请尝试:

source /usr/local/rvm/scripts/rvm

回答by Ajeet Khan

The scripts folder is inside the zipped directory, so first we need to extract it and then run the command. Do the following things.

脚本文件夹位于压缩目录中,因此首先我们需要解压缩它,然后运行命令。做以下几件事。

cd ~/.rvm/archives
tar xvzf rvm-1.26.0.tgz # or whatever RVM version you have

This will extract the folder, and in this, there will be a folder named scripts. Now run the following command.

这将解压缩文件夹,其中将有一个名为 scripts 的文件夹。现在运行以下命令。

source ~/.rvm/archives/rvm-1.26.11/scripts/rvm

And you are done.

你已经完成了。

回答by avinash

me too got the same issue and get it resolved by simply changing my user from root to another normal user, i'm using ubuntu subsystem in windows 10

我也遇到了同样的问题,只需将我的用户从 root 更改为另一个普通用户即可解决,我在 Windows 10 中使用 ubuntu 子系统