如何摆脱每个新终端会话上运行的东西?

Inc*_*982 6 bash rvm

我正在使用Lion.我有一个错误,在每个新的终端会话输出:

-bash: __rvm_add_to_path: command not found
Run Code Online (Sandbox Code Playgroud)

这是一个几乎全新的用户帐户.. RVM安装在机器上的另一个帐户上.~/.bashrc&〜/ .bash_profile都是空白的... env的输出是:

TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/ry/8zsyknmx7dj4_2zzvn1n71500000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-jsfKPw/Render
TERM_PROGRAM_VERSION=303
TERM_SESSION_ID=3EBC0F1A-9867-41E5-8873-75E84B9F712F
USER=incorvia
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-ZQqgPj/Listeners
Apple_Ubiquity_Message=/tmp/launch-u3d1lp/Apple_Ubiquity_Message
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
PWD=/bin
LANG=en_US.UTF-8
HOME=/Users/incorvia
SHLVL=1
LOGNAME=incorvia
DISPLAY=/tmp/launch-0B0I8s/org.x:0
_=/usr/bin/env
Run Code Online (Sandbox Code Playgroud)

我在这里看不到任何与RVM有关的内容..我还能在哪里看到它?

=====

在/ etc/bashrc中

# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
    update_terminal_cwd() {
        # Identify the directory using a "file:" scheme URL,
        # including the host name to disambiguate local vs.
        # remote connections. Percent-escape spaces.
        local SEARCH=' '
        local REPLACE='%20'
        local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
        printf '\e]7;%s\a' "$PWD_URL"
    }
    PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi
Run Code Online (Sandbox Code Playgroud)

=========

固定...

在/ etc/profile的底部,它是源于/etc/profile.d/rvm.sh

不知道那是怎么到的......

sim*_*ont 12

Bash在启动期间加载一系列文件.可以在此处找到有关bash启动过程的概述.

一般情况下,全局设置,/etc/profile,/etc/bashrc,和相关的个性化设置,~/.profile~/.bashrc加载,虽然稍微分布相关的(和Mac OS X上,例如,在默认情况下/etc/profile不存在).

RVM安装页面:

多用户:

如果以root身份安装,将为系统上的每个用户自动配置rvm功能.这是通过在登录时加载/etc/profile.d/rvm.sh来完成的.大多数Linux发行版默认解析/ etc/profile,其中包含加载驻留在/etc/profile.d/目录中的所有文件的逻辑.一旦您添加了希望能够将RVM用于rvm组的用户,这些用户必须注销并重新登录才能获得rvm组成员身份,因为组成员资格仅在初始登录时由操作系统评估.

我猜其他用途已安装在Multi-User模式中; /etc/profile可能加载/etc/profile.d/rvm.sh.

要阻止它被加载,你可以删除该source RVM/etc/profile- 这将阻止为所有用户加载它.