/ / Rubyはどこで$ PATHに追加されていますか? - ルビ、bash、パス、環境変数

Rubyはどこで$ PATHに追加されていますか? - ルビ、bash、パス、環境変数

私はMacのYosemiteをbashシェルで使っています。 私はRuby 2.2.1をインストールしましたが、それをアップグレードしたいので、Ruby 2.3.0をインストールしました。しかし、私の端末を再起動すると、私のPATHにある私の古いRubyのインストール...

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;%sa" "$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*

回答:

回答№1は2

RVMはあなたのためにRubyと関連PATHSを設定しています。 取得するため 2.3 これを実行する

rvm --default use 2.3.0