Skip to content

Instantly share code, notes, and snippets.

@perplexes
Created December 29, 2009 20:42
Show Gist options
  • Save perplexes/265584 to your computer and use it in GitHub Desktop.
Save perplexes/265584 to your computer and use it in GitHub Desktop.
# Find the path of the Gem given. Toss this in your ~/.bashrc or ~/.profile
# Usage:
# $ gempath mechanize
# /Library/Ruby/Gems/1.8/gems/mechanize-0.9.3
#
# My use case: open up the gem code to inspect it.
# $ mate `gempath mechanize`
alias gempath='ruby -rubygems -e "puts Gem.cache.find_name(ARGV.first).first.loaded_from.gsub(/specifications/, %q(gems)).gsub(/\.gemspec/, %q())"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment