I am using oh-my-zsh with plugins=(git bundler)
in my .zshrc
. So, I don't need bundler to generate binstubs. But bundler does it anyway.
➜ bundle Using rake (0.9.2.2) ... Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
✗ ls bin erubis haml nokogiri rails rake2thor rdoc resque-web sass scss thor tt guard html2haml rackup rake rdiscount resque ri sass-convert thin tilt
Why did the binstubs get generated -- I didn't pass an option asking for them. At least, I don't think I am:
➜ which bundle /Users/david/.rbenv/shims/bundle ➜ cat /Users/david/.rbenv/shims/bundle
#!/usr/bin/env bash set -e export RBENV_ROOT="/Users/david/.rbenv" exec rbenv exec "${0##*/}" "$@"
I don't have anything in my ~/.bundle/config
either.
Please help me put the kabosh on the undesired binstubs!
Binstubs are scripts that wrap around executables. Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it into bin/ . Binstubs are a shortcut-or alternative- to always using bundle exec .
Beginning in Rails 4, Rails ships with a rails binstub at ./bin/rails that should be used instead of the Bundler-generated rails binstub. So, at the end of the day there's no difference. But considering the fact that Rails goes through the trouble of shipping its own binstubs, I'd favor bin/rails alternative.
This command generates binstubs for executables in GEM_NAME. Binstubs are put into bin, or the --path directory if one has been set. Calling binstubs with [GEM ] will create binstubs for all given gems.
By default, bundler does not generate wrappers for gem binaries. To make use of the proper version of a gem binary, users are forced to prefix every command with bundle exec. This makes working in the console rather painful.
How Do I Stop a Bundle Generating? So you’ve hit generate but have discovered you need to make another couple of changes. Don’t fret, simply follow these steps to stop the process. Step One: Select the ‘Save’ drop-down, as shown above. Step Two: Click ‘Cancel Generating‘.
For example, if you run bundle binstubs rspec-core, Bundler will create the file bin/rspec. That file will contain enough code to load Bundler, tell it to load the bundled gems, and then run rspec.
Bundler generates binstubs on a per-application basis. If you ran bundle install --binstubs
at some point in the past, Bundler will remember that and generate binstubs anytime you run install again. To disable them, you can either run bundle install --no-binstubs
, or run rm -rf .bundle/config
. Either way, that will disable binstub generation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With