bin_path (Gem)

    # File lib/rubygems.rb, line 367
      def self.bin_path(name, exec_name = nil, *version_requirements)
        version_requirements = Gem::Requirement.default if
          version_requirements.empty?
        spec = Gem.source_index.find_name(name, version_requirements).last

        raise Gem::GemNotFoundException,
              "can't find gem #{name} (#{version_requirements})" unless spec

        exec_name ||= spec.default_executable

        unless exec_name
          msg = "no default executable for #{spec.full_name}"
          raise Gem::Exception, msg
        end

        unless spec.executables.include? exec_name
          msg = "can't find executable #{exec_name} for #{spec.full_name}"
          raise Gem::Exception, msg
        end

        File.join(spec.full_gem_path, spec.bindir, exec_name)
      end