Skip to content

Instantly share code, notes, and snippets.

@passcod
Created March 22, 2012 15:00
Show Gist options
  • Save passcod/2158842 to your computer and use it in GitHub Desktop.
Save passcod/2158842 to your computer and use it in GitHub Desktop.
Use either 1.9.3 or 1.9.2 with RVM
#!/usr/bin/env bash
ruby_string="ruby-1.9.3"
ruby_alt_string="ruby-1.9.2"
gemset_name="tavignano"
if (( `rvm list strings | grep -c "${ruby_string}"` ))
then
# Load or create the specified environment
rvm --create use "${ruby_string}@${gemset_name}"
elif (( `rvm list strings | grep -c "${ruby_alt_string}"` ))
then
# Load or create the specified environment
rvm --create use "${ruby_alt_string}@${gemset_name}"
else
# Notify the user to install the desired interpreter before proceeding.
echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment