直到我运行"source〜/.profile",RVM才能被识别.在终端 [英] RVM isn't recognized until I run "source ~/.profile" in terminal
问题描述
sergio@sergio-VirtualBox:~/code$ rails -v
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
sergio@sergio-VirtualBox:~/code$ source ~/.profile
sergio@sergio-VirtualBox:~/code$ rails -v
Rails 3.2.1
有什么想法为什么在我运行"source〜/.profile"之前该命令不起作用?我不想每次运行机器或打开新的终端窗口时都这样做.
Any ideas why the command doesn't work until I run "source ~/.profile"? I would like to not have to do this every time I run my machine or open a new terminal window.
推荐答案
RVM提供了很好的描述 https ://rvm.io/support/faq/#shell_login
RVM provides quite good description https://rvm.io/support/faq/#shell_login
您应该使用.bash_profile-除非您有充分的理由反对它-但我知之甚少.
you should use .bash_profile - unless you have good reasons against it - but I do not know many.
Rvm在您的一个RC文件中放置了一个采购行,如果是.profile,则应删除该行,创建.bash_profile,并更新rvm:
Rvm puts a sourcing line in one of your RC files, in your case it was .profile, you should remove that line, create .bash_profile, and update rvm:
sed -i '/source.*rvm/ d' ~/.profile
touch ~/.bash_profile
rvm get head --auto-dotfiles
这篇关于直到我运行"source〜/.profile",RVM才能被识别.在终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!