Created
May 27, 2011 12:38
-
-
Save bgarret/995154 to your computer and use it in GitHub Desktop.
.rvmrc for automatic gemset creation
This file contains hidden or 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="1.9.2" | |
gemset_name="tiffandmo" | |
if rvm list strings | grep -q "${ruby_string}" ; then | |
# Load or create the specified environment | |
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ | |
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then | |
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" | |
else | |
rvm --create "${ruby_string}@${gemset_name}" | |
fi | |
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