Ubuntu rvm setup issue

喜你入骨 提交于 2019-12-23 20:01:10

问题


I followed this tutorial below:

https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm

This worked perfectly for me; however, I have one small problem?

Each time I open a new terminal I have to run this command in order for rails to work:

source ~/.rvm/scripts/rvm

What is the problem and why is rvm not recognized

This is what I see after I open a new terminal and verify rails:

robert@rob:~$ rails -v The program 'rails' is currently not installed. You can install it by typing: sudo apt-get install rails

Thanks


回答1:


I highly recommend you to use the official website to install RVM: https://rvm.io/rvm/install


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.

To solve this, run this command line: (if using login-shell)

echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile

Or this (if using non-login shell):

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

This will add the path to RVM to load at each Terminal instanciation (close & re-open a terminal after you did this).


Take a look at @mpapis comments



来源:https://stackoverflow.com/questions/19298814/ubuntu-rvm-setup-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!