Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using binstubs for all gems with the deprecated --binstubs #3251

Closed
DannyBen opened this issue Feb 3, 2020 · 6 comments · Fixed by #3872
Closed

Using binstubs for all gems with the deprecated --binstubs #3251

DannyBen opened this issue Feb 3, 2020 · 6 comments · Fixed by #3872

Comments

@DannyBen
Copy link

DannyBen commented Feb 3, 2020

I am trying to figure out how to properly set up bundler in Github actions, and bumped into what seems to be a missing or at least confusing functionality.

bundle install --binstubs is deprecated

$ bundle install --binstubs ./bin
[DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs`

bundle binstubs does not have a way to stub all gems

And, in addition it points to the deprecated --binstubs flag, which I am guessing is a documentation issue.

$ bundle binstubs --help
SYNOPSIS
       bundle binstubs GEM_NAME [--force] [--path PATH] [--standalone]

# ... snip ...

BUNDLE INSTALL --BINSTUBS
       To  create  binstubs  for  all  the  gems in the bundle you can use the
       --binstubs flag in bundle install(1) bundle-install.1.html.

So - what is the proper way to binstub all gems?


To add some context: When using a vendor path for the bundle (for caching), then any installed gem that comes with a binary, is not found in the path. This is why I started looking at this binstubs feature (which I never used before).

I would much rather avoid creating these binstubs, and instead, just add the vendor/bundle/.../bin folder to the path, but I was unable to find the proper command to obtain this path - as it seems to differ from system to system.

I was hoping there is some bundler env get bin_path or similar so I can do this in GitHub Actions:

- name: Bundle install
  run: |
    gem install bundler
    bundle config path vendor/bundle
    bundle install --jobs 4 --retry 3
    echo "::add-path::$(bundle env get bin_path)"   
@hsbt hsbt transferred this issue from rubygems/bundler Mar 14, 2020
@ErikHumphrey
Copy link

It looks like the original card for this issue mentioned an --all option, but it didn't make it in.

@deivid-rodriguez
Copy link
Member

Actually bundle binstubs --all is implemented, and works!

We need to fix both the documentation and the deprecation message.

rreinhardt9 added a commit to rreinhardt9/rubygems that referenced this issue Aug 2, 2020
Resolves rubygems#3251

Update the deprecation warning to point the user to the `--all` option
for bundle binstubs as the preferred way to install binstubs for all
gems in a bundle.

Update `bundle binstubs` man page to include the `--all` option 🎉
and remove the note pointing to the now deprecated method of installing
all binstubs.
rreinhardt9 added a commit to rreinhardt9/rubygems that referenced this issue Aug 2, 2020
Resolves rubygems#3251

Update the deprecation warning to point the user to the `--all` option
for bundle binstubs as the preferred way to install binstubs for all
gems in a bundle.

Update `bundle binstubs` man page to include the `--all` option 🎉
and remove the note pointing to the now deprecated method of installing
all binstubs.
@nateww
Copy link

nateww commented Dec 10, 2020

FYI, the docs on the bundle website still don't document the --all flags.

See https://bundler.io/v2.1/man/bundle-binstubs.1.html

@deivid-rodriguez
Copy link
Member

Right, these docs will be present in bundler 2.2 docs.

@deivid-rodriguez
Copy link
Member

Docs are live now: https://bundler.io/v2.2/man/bundle-binstubs.1.html.

@nateww
Copy link

nateww commented Dec 10, 2020

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants