gpt4 book ai didi

ruby - OS X Mavericks 安装 rvm 警告

转载 作者:数据小太阳 更新时间:2023-10-29 07:23:50 25 4
gpt4 key购买 nike

在终端运行时:

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

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

 * 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,出现错误

-bash: rvm: command not found'

我是终端机和 Ruby 的新手,所以非常感谢任何帮助。

最佳答案

当你安装 rvm 时,它的路径被添加到 ~/.bash_profile。如您所见,RVM 会在安装过程中警告您。您可以在每次加载终端时运行 source ~/.profile,但这很麻烦。

来自 bash 文档:

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 正在运行,而 /.profile/.bashrc 正在被忽略。

要解决此问题,只需打开 .bash_profile 并复制顶部的 rvm 路径并将它们粘贴到 .bashrc 文件的顶部。打开一个新的终端窗口,它应该可以正常工作。 如果 .bash_profile 是空的,您可以删除它;如果您选择保留它,则可以将 ~/.profile 的内容复制并粘贴到其中。

关于ruby - OS X Mavericks 安装 rvm 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19636779/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com