OS X小牛安装rvm警告 [英] OS X Mavericks install rvm WARNING

查看:131
本文介绍了OS X小牛安装rvm警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在终端中运行时:

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

它似乎工作正常,但在升级说明最后, p>

It seems to work fine, but in the Upgrade Notes at the end it says

 * WARNING: You have '~/.profile' file, you might want to load it,
    to do that add the following line to '/Users/steven/.bash_profile':

      source ~/.profile

我无法使用RVM,得到错误

And I can't use RVM, getting the error

-bash: rvm: command not found'

我对terminal和Ruby很新鲜,所以任何帮助将非常感激。

I am pretty new to terminal and Ruby, so any help would be greatly appreciated.

推荐答案

安装rvm时,其路径将添加到〜/ .bash_profile 。 RVM会在您注意到安装过程中警告您。每次加载终端时,您可以运行源〜/ .profile ,但这是一个痛苦的脖子。

When you install rvm its paths get added to ~/.bash_profile. RVM will warn you about this during installation as you noticed. You could run source ~/.profile each time you load the terminal, but that's a pain in the neck.

从bash文档:


当bash作为交互式登录shell调用时,或作为非交互式shell使用--login选项,它首先从/ etc / profile文件读取并执行命令(如果该文件存在)。读取该文件后,它按顺序查找〜/ .bash_profile,〜/ .bash_login和〜/ .profile,并从第一个读取并执行可执行的命令。

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

这意味着 /。bash_profile 正在运行, /。

What this means is that /.bash_profile is being run, and /.profile and /.bashrc are being ignored.

要解决这个问题只需打开

To resolve this just open .bash_profile and copy the rvm paths at the top and paste them at the top of your .bashrc file. Open a new terminal window and it should be working just fine. You can either delete .bash_profile, if it's empty, or copy and paste the contents of ~/.profile into it if you choose to keep it.

这篇关于OS X小牛安装rvm警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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