Gem.bin_path(\'cucumber\', \'cucumber\')
Will return the binary/executable\'s path. It seems there is no such function to return the library path.
After the gem has been loaded with require, you find the lib path using Gem.loaded_specs as follows:
require 'rubygems' require 'cucumber' gem_root = Gem.loaded_specs['cucumber'].full_gem_path gem_lib = File.join(gem_root, 'lib')