Skip to content

Instantly share code, notes, and snippets.

@valk
Created November 22, 2014 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valk/d53ce07c5bad23e9e08e to your computer and use it in GitHub Desktop.
Save valk/d53ce07c5bad23e9e08e to your computer and use it in GitHub Desktop.
Find the location of the specified gem. Usage: ruby wheregem.rb activerecord
gemname = ARGF.argv[0]
spec = Gem::Specification.find_by_name(gemname)
gem_root = spec.gem_dir
gem_lib = gem_root + "/lib"
puts gem_lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment