Created
November 22, 2014 20:52
-
-
Save valk/d53ce07c5bad23e9e08e to your computer and use it in GitHub Desktop.
Find the location of the specified gem. Usage: ruby wheregem.rb activerecord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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