Skip to content

Instantly share code, notes, and snippets.

@dcuddeback
Created June 12, 2011 18:31
Show Gist options
  • Save dcuddeback/1021857 to your computer and use it in GitHub Desktop.
Save dcuddeback/1021857 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
{
DEFAULT="\033[0m"
CYAN="\033[0;36m"
ruby_string="1.9.2"
gemset_name=$(git remote show -n origin | grep -i url | head -n 1 | sed 's;.*/;;g' | sed 's;\.git$;;')
# setup RVM environment
rvm use --create "${ruby_string}@${gemset_name}"
if [[ -f Gemfile ]]
then
# setup Bundler
if ! gem list | grep -q bundler
then
echo -e "${CYAN}The rubygem 'bundler' is not installed, installing it now.${DEFAULT}"
gem install bundler
fi
# install gems
echo -e "${CYAN}Bundling your gems this may take a few minutes on a fresh clone.${DEFAULT}"
bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
fi
} >&2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment