Skip to content

Instantly share code, notes, and snippets.

@tpope
Created August 24, 2011 02:52
Show Gist options
  • Select an option

  • Save tpope/1167200 to your computer and use it in GitHub Desktop.

Select an option

Save tpope/1167200 to your computer and use it in GitHub Desktop.
Use .rbenv-version with RVM
# ~/.rvm/hooks/after_cd
local dir="$PWD"
while [ "$(dirname "$dir")" != "$dir" ]; do
if [ -f "$dir/.rbenv-version" ]; then
rvm use "$(cat "$dir/.rbenv-version")"
break
fi
dir="$(dirname "$dir")"
done
@tpope
Copy link
Author

tpope commented Aug 24, 2011

Why? So I can set the version without putting up with the crap that SOME people like to put in .rvmrcs.

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