Skip to content

Instantly share code, notes, and snippets.

@nicolas-brousse
Created June 6, 2013 15:22
Show Gist options
  • Select an option

  • Save nicolas-brousse/5722365 to your computer and use it in GitHub Desktop.

Select an option

Save nicolas-brousse/5722365 to your computer and use it in GitHub Desktop.
Pow RC file for use rvm with .ruby-version and .ruby-gemset files
#!/usr/bin/env bash
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
source "$rvm_path/scripts/rvm"
ruby_version=`cat .ruby-version`
ruby_gemset=`cat .ruby-gemset`
environment_id="$ruby_version@$ruby_gemset"
rvm use "$environment_id" || {
echo "Failed to open RVM environment '${environment_id}'."
return 1
}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment