Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent bundler from generating binstubs?

Tags:

zsh

bundler

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!

like image 549
David J. Avatar asked Jul 26 '12 04:07

David J.


People also ask

What is bundle Binstubs bundler?

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 .

Should be used instead of the bundler generated rails Binstub?

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.

How do I generate binstubs for executables?

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.

Why doesn't bundler generate wrappers for gem binaries?

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 from generating?

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‘.

How to use bundler with RSpec?

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.


1 Answers

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.

like image 84
indirect Avatar answered Sep 23 '22 07:09

indirect