Skip to content

Instantly share code, notes, and snippets.

@henrrrik
Forked from mrrooijen/rbenvsudo.sh
Created September 18, 2012 15:11
Show Gist options
  • Save henrrrik/3743672 to your computer and use it in GitHub Desktop.
Save henrrrik/3743672 to your computer and use it in GitHub Desktop.
A little shell function that allows you to perform rbenv (gem) commands with sudo privileges. Similar to rvmsudo.
function rbenvsudo(){
executable=$1
shift 1
sudo $(rbenv which $executable) $*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment