Ruby 在哪里添加到我的 $PATH?

Where is Ruby getting added to my $PATH?

我正在使用 Mac Yosemite 和 bash shell。我已经安装了 Ruby 2.2.1,但后来想升级它,所以我安装了 Ruby 2.3.0。但是,当我重新启动我的终端时,我的旧 Ruby 安装在我的 PATH …

Daves-MacBook-Pro-2: davea$ echo $PATH
/Users/davea/.rvm/gems/ruby-2.2.1/bin:/Users/davea/.rvm/gems/ruby-2.2.1@global/bin:/Users/davea/.rvm/rubies/ruby-2.2.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin/:/opt/gradle-2.7/bin:/opt/apache-maven-3.3.3/bin:/Users/davea/.rvm/bin:/usr/local/mysql/bin

我不知道我的 PATH 的这一部分是如何设置的。我已经在我的系统上检查了这些文件

/etc/profile
/etc/bashrc
~/.profile
~/.bash_profile

但我在任何地方都看不到对 Ruby 2.2.1 的引用。以下是文件的内容。是否有任何其他文件我应该检查以查找对 $PATH 的引用?

/etc/profile

# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
        [ -r /etc/bashrc ] && . /etc/bashrc
fi

JBOSS_HOME=/opt/wildfly-10.0.0.CR2
M2_HOME=/opt/apache-maven-3.3.3
CATALINA_HOME=/opt/apache-tomcat-6.0.44
GRADLE_HOME=/opt/gradle-2.7

PATH=$PATH:/usr/local/mysql/bin/:$GRADLE_HOME/bin:$M2_HOME/bin

/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

~/.profile

export JBOSS_HOME=$JBOSS_HOME
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

MYSQL=/usr/local/mysql/bin
export PATH=$PATH:$MYSQL
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

~/.bash_profile

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

RVM 正在为您设置 Ruby 和相关路径。 得到2.3运行这个

rvm --default use 2.3.0