Friday, March 5, 2010

switching between ruby 1.8 and 1.9

So if you followed homebrew + ruby 1.9 + rails 3.0 instructions from the previous post,  you now have ruby 1.9.x in your /usr/local/bin, and ruby 1.8.x in your /usr/bin. Same applies to gems, and thus rails.
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

1 comment:

684sgsnb8z said...

So, they convey out their notably beneficiant bonuses, rewards, and promotions during the summer season to entice new gamers and retain the old gamers. Secondly, you’ve in all probability heard of the payout percentage which applies to video slots. So, say a slot machine has 퍼스트카지노 a payout percentage of 97%, because of this 97% folks who|of people that} play that slot will win whereas 3% goes again to the casino. First, all casinos have something that's referred to as a house advantage. With this, casinos don't have to cheat because of|as a result of} they at all times win whatever the game.