Created
March 22, 2012 15:00
-
-
Save passcod/2158842 to your computer and use it in GitHub Desktop.
Use either 1.9.3 or 1.9.2 with RVM
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
#!/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