Sometimes you need to know where a gem is installed, or at least, where Ruby thinks a gem is installed, from within Ruby.
find_by_name method of
 pry(main)> Gem::Specification::find_by_name('puppet').gem_dir => "/usr/lib/ruby/gems/1.9.1/gems/puppet-3.1.1"
.gem_dir for a lot more info.
Additional tip: from the commandline,
gem which might be what you need, but note that this will return the full path to the library, not the containing directory.