Skip to content

Instantly share code, notes, and snippets.

@jdee
Last active August 29, 2015 14:04
Show Gist options
  • Save jdee/e81170da4f86dbbc61cd to your computer and use it in GitHub Desktop.
Save jdee/e81170da4f86dbbc61cd to your computer and use it in GitHub Desktop.
failing script without rvm use default
# From: http://beginrescueend.com/workflow/scripting/
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
export RAILS_ENV=production
cd $APP_PATH
rvm use default # <= fails without this
bundle exec rake do_something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment