Created
August 8, 2009 10:40
-
-
Save hughevans/164379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chruby () { | |
v=`ruby -e "puts RUBY_VERSION.split('.')[0,2].join('.')"` | |
if [ $v = "1.9" ]; then | |
cv="1.8" | |
else | |
cv="1.9" | |
fi | |
rubyexes=(erb gem irb rake rdoc ri ruby testrb) | |
for i in ${rubyexes[*]}; do | |
sudo unlink "/opt/local/bin/${i}" | |
sudo ln -s "/opt/local/bin/${i}${cv}" "/opt/local/bin/${i}" | |
done | |
echo "Now Running: "`ruby -v` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment