Skip to content

Instantly share code, notes, and snippets.

@stephenbaidu
Created March 16, 2019 17:45
Show Gist options
  • Save stephenbaidu/05722bdc4da2860a48cb87e9c106e371 to your computer and use it in GitHub Desktop.
Save stephenbaidu/05722bdc4da2860a48cb87e9c106e371 to your computer and use it in GitHub Desktop.
# ~/.bash_profile
# You can load both rvm and asdf in ~/.bash_profile
# This makes it easy to switch what to load
# RVM
# source $HOME/.rvm/scripts/rvm
# ASDF
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
use-rvm () {
sed -i "" 's|^# source $HOME/.rvm/scripts/rvm|source $HOME/.rvm/scripts/rvm|' ~/.bash_profile
sed -i "" 's|^. $HOME/.asdf/asdf.sh|# . $HOME/.asdf/asdf.sh|' ~/.bash_profile
bash --login
}
use-asdf () {
sed -i "" 's|^source $HOME/.rvm/scripts/rvm|# source $HOME/.rvm/scripts/rvm|' ~/.bash_profile
sed -i "" 's|^# . $HOME/.asdf/asdf.sh|. $HOME/.asdf/asdf.sh|' ~/.bash_profile
bash --login
}
@JuPlutonic
Copy link

JuPlutonic commented Oct 8, 2021

rvm, system installed, tends to add rewrite gem path, so suggests to add
unset GEM_HOME; unset GEM_PATH in use-asdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment