Let's say you want switch environments, how do you do that?
Well it's simple. You want to put either /usr/bin or /usr/local/bin in front in your shell's $PATH variable. And you can do this with simple aliases:
alias ruby19="export PATH=/usr/local/bin:/usr/bin:`echo $PATH| sed -E 's/\/usr(\/local){0,1}\/bin[:]{0,1}//g'`"
alias ruby18="export PATH=/usr/bin:/usr/local/bin:`echo $PATH| sed -E 's/\/usr(\/local){0,1}\/bin[:]{0,1}//g'`"
now you can switch simply by running ruby18 or ruby19 in a terminal windows, to make it stay, just add these lines to your ~/.bash_profile
No comments:
Post a Comment