Above doesn\'t work first time, works 2nd time.
Try to set ruby version to 2.0.0 for any new shell windows.
Doing
$ rvm use 2.0.0 --default
<
It worked after commenting top 2 duplicate lines and adding them at bottom. Don't forget to restart the terminal for it to work.
#[[ -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*
export PATH="/usr/local/opt/postgresql@9.6/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/postgresql@9.6/lib"
[[ -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*