Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7771145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:34:39+00:00 2026-06-01T16:34:39+00:00

Gem.bin_path(‘cucumber’, ‘cucumber’) Will return the binary/executable’s path. It seems there is no such function

  • 0
Gem.bin_path('cucumber', 'cucumber')

Will return the binary/executable’s path.
It seems there is no such function to return the library path.
Which in this case would, ideally, return:

/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-meta-bdd/gems/cucumber-0.10.0/lib

Have I missed something or is there a simple/one method way to get this information?

Updated: No CLI or non-stdlib suggestions please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:34:41+00:00Added an answer on June 1, 2026 at 4:34 pm

    The problem with the checked answer is that you must “require” the rubygem or it won’t work. Often this is undesireable because if you’re working with an executable gem, you don’t want to “require” it or you’ll get a bunch of warnings.

    This is a universal solution for executables and libs:

    spec = Gem::Specification.find_by_name("cucumber")
    gem_root = spec.gem_dir
    gem_lib = gem_root + "/lib"
    

    If you want to get really technical, there isn’t just one lib directory. The gemspec has a “require_paths” array of all the directorys to search (added to $LOAD_PATH). So, if you want an array of the require_paths, use this:

    gem_lib = gem_root + "/" + spec.require_paths[0]
    

    No need for bundler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

By default, when you sudo gem install thegemname it will install executables into /usr/bin/
Is there any ruby gem/ rails plugin available for parsing the resume and importing
when I execute Mathieu$ /Users/Mathieu/.gem/ruby/1.8/bin/wsdl2ruby.rb path --wsdl https://www.arello.com/webservice/verify.cfc?wsdl --type client --force I get at
Gemfile gem wicked_pdf gem wkhtmltopdf-binary the error: RuntimeError in CarsController#show Failed to execute: /usr/bin/wkhtmltopdf
i seem to have a discrepancy between production's gem path when I installed manually
I need to get the installation path for a given ruby gem and can't
I'm creating a gem which has several scripts in the bin directory the utility
The first line of bin/jekyll of the Jekyll gem uses the following syntax: $:.unshift
gem install heroku failed with following message and I have tried the solution here
Problem: gem generate fails because it's missing XML Builder. $ gem generate ERROR: While

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.