Skip to content

Instantly share code, notes, and snippets.

@JohnColvin
Created June 20, 2013 02:30
Show Gist options
  • Select an option

  • Save JohnColvin/5819888 to your computer and use it in GitHub Desktop.

Select an option

Save JohnColvin/5819888 to your computer and use it in GitHub Desktop.
Automatically rehash rbenv when installing a gem
gem-and-rehash() {
gem "$@"
if [ $1 ] && [ $1 = "install" ] ; then rbenv rehash ; fi
}
alias gem=gem-and-rehash
@JohnColvin
Copy link
Copy Markdown
Author

I don't know bash well, but this works. Sometimes it seems to go a little haywire, though, and I don't know why.

@JohnColvin
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment