-1

I’m using Mac Yosemite with bash shell. I had installed Ruby 2.2.1 but then wanted to upgrade it, so I installed Ruby 2.3.0. However, when I restart my terminal, my old Ruby installations in my 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

I can’t figure out how this part of my PATH is getting set. I have checked these files on my system

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

But I don’t see references to Ruby 2.2.1 anywhere. Below are the files’ content. Are there any other files I should check to find references to the $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*
Dave
  • 15,639
  • 133
  • 442
  • 830
  • Hi man , this question is dup... there are many questions that have been answered ...e.g http://stackoverflow.com/questions/4911504/rvm-installed-by-ruby-not-working – z atef Jan 28 '16 at 16:45

1 Answers1

2

RVM is setting up Ruby and related PATHS for you. To get 2.3 run this

rvm --default use 2.3.0
Babar Al-Amin
  • 3,939
  • 1
  • 16
  • 20