直到我运行"source〜/.profile",RVM才能被识别.在终端 [英] RVM isn't recognized until I run "source ~/.profile" in terminal

查看:70
本文介绍了直到我运行"source〜/.profile",RVM才能被识别.在终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆