How to prevent bundler from generating binstubs

bundlerzsh

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!

Best Answer

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.