Skip to content

Instantly share code, notes, and snippets.

@Pistos
Created May 2, 2010 23:36
Show Gist options
  • Save Pistos/387553 to your computer and use it in GitHub Desktop.
Save Pistos/387553 to your computer and use it in GitHub Desktop.
A little wrapper script to run RVM-based Ruby interpreters from cron
#!/bin/bash
if [[ -z ${2} ]]; then
echo "$0 <ruby interpreter|'default'> <arguments to ruby interpreter>"
exit 1
fi
if [[ -s /opt/rvm/scripts/rvm ]] ; then source /opt/rvm/scripts/rvm ; fi
rvm use "${1}"
ruby "${@:2}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment