Skip to content

Instantly share code, notes, and snippets.

@rbriank
Created April 5, 2010 18:26
Show Gist options
  • Save rbriank/356682 to your computer and use it in GitHub Desktop.
Save rbriank/356682 to your computer and use it in GitHub Desktop.
simple rvm version switcher
# add a .rvm file to APP_ROOT containing only the version
# e.g. 1.9.1
# add this to your .bashrc file
cd () {
command cd "$@";
if [ -f ./.rvm ]; then
version=`cat ./.rvm`
if [ `ruby -v | grep -c $version` == 0 ]; then
rvm $version
echo "switched to ruby $version"
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment