Skip to content

Instantly share code, notes, and snippets.

@rafarubert
Created July 2, 2011 18:13
Show Gist options
  • Save rafarubert/1061483 to your computer and use it in GitHub Desktop.
Save rafarubert/1061483 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
ruby_string="1.9.2"
gemset_name="egenda"
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
#(
# Ensure that Bundler is installed, install it if it is not.
# if ! command -v bundle ; then
# gem install bundler
#fi
# Bundle while redcing excess noise.
#bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
#)&
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