问题描述
我按照以下教程进行操作:
I followed this tutorial below:
这对我来说非常有效;但是,我有一个小问题?
This worked perfectly for me; however, I have one small problem?
每次我打开一个新终端时,我都必须运行这个命令才能让 rails 工作:
Each time I open a new terminal I have to run this command in order for rails to work:
源代码 ~/.rvm/scripts/rvm
source ~/.rvm/scripts/rvm
是什么问题,为什么rvm无法识别
What is the problem and why is rvm not recognized
这是我打开新终端并验证 rails 后看到的:
This is what I see after I open a new terminal and verify rails:
robert@rob:~$ rails -v当前未安装程序rails".您可以通过键入以下内容来安装它:sudo apt-get 安装导轨
robert@rob:~$ rails -vThe program 'rails' is currently not installed. You can install it by typing:sudo apt-get install rails
谢谢
推荐答案
强烈推荐大家使用官网安装RVM:https://rvm.io/rvm/install
I highly recommend you to use the official website to install RVM: https://rvm.io/rvm/install
您的问题是当您打开新终端时未加载 RVM,这就是您必须在终端的每个实例中手动添加源的原因.
Your problem is that RVM is not loaded when you open a new terminal, this is why you have to manually add the source at each instance of the Terminal.
要解决此问题,请运行以下命令行:(如果使用 login-shell)
To solve this, run this command line: (if using login-shell)
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
或者这个(如果使用非登录shell):
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bashrc
这将添加到 RVM 的路径以在每个终端实例化时加载(完成此操作后关闭并重新打开终端).
This will add the path to RVM to load at each Terminal instanciation (close & re-open a terminal after you did this).
看看@mpapis 的评论
这篇关于Ubuntu rvm 设置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!