Skip to content

Instantly share code, notes, and snippets.

@AlphaDaniel
Created June 7, 2018 07:02
Show Gist options
  • Save AlphaDaniel/7fcfd40095ac632a76b9fd973cedcc1b to your computer and use it in GitHub Desktop.
Save AlphaDaniel/7fcfd40095ac632a76b9fd973cedcc1b to your computer and use it in GitHub Desktop.
RVM Ruby default issue
#==================================================================================
# -GET ALIASES AND FUNCTIONS- #
#==================================================================================
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
#==================================================================================
# -USER SPECIFIC ENVIRONMENT AND STARTUP PROGRAMS- #
#==================================================================================
# THIS SECTION NEEDED FOR INSTALLING RUBY IN HOME DIR WHICH IS REQUIRED FOR BUNDLER TO WORK
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export rvmsudo_secure_path=1
export PATH
source $HOME/.nvm/nvm.sh
export rvm_path=~/.rvm
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
#===================================================================================================================
export PATH=$PATH:$HOME/.local/bin:$HOME/bin
# load nvm
export NVM_DIR="/home/ec2-user/.nvm"
[ "$BASH_VERSION" ] && npm() {
# hack: avoid slow npm sanity check in nvm
if [ "$*" == "config get prefix" ]; then which node | sed "s/bin\/node//";
else $(which npm) "$@"; fi
}
# [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
rvm_silence_path_mismatch_check_flag=1 # prevent rvm complaints that nvm is first in PATH
unset npm # end hack
# User specific aliases and functions
alias python=python27
# modifications needed only in interactive mode
if [ "$PS1" != "" ]; then
# Set default editor for git
git config --global core.editor /usr/bin/nano
# Turn on checkwinsize
shopt -s checkwinsize
# keep more history
shopt -s histappend
export HISTSIZE=100000
export HISTFILESIZE=100000
export PROMPT_COMMAND="history -a;"
# Source for Git PS1 function
if ! type -t __git_ps1 && [ -e "/usr/share/git-core/contrib/completion/git-prompt.sh" ]; then
. /usr/share/git-core/contrib/completion/git-prompt.sh
fi
# Cloud9 default prompt
_cloud9_prompt_user() {
if [ "$C9_USER" = root ]; then
echo "$USER"
else
echo "$C9_USER"
fi
}
PS1='\[\033[01;32m\]$(_cloud9_prompt_user)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)" 2>/dev/null) $ '
fi
# USE "set-title new_title" TO CHANGE TERMINAL TAB TITLE
function set-title() {
if [[ -z "$ORIG" ]]; then
ORIG=$PS1
fi
TITLE="\[\e]2;$*\a\]"
PS1=${ORIG}${TITLE}
}
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment