You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using chruby masks binstubs installed per-project (http://robots.thoughtbot.com/post/15346721484/use-bundlers-binstubs). I see in the contribution guidelines that you want to cut down on environment variable proliferation, which I agree with, but allowing a sub-path that gets prepended to the modified PATH each time ruby is changed seems most appropriate for this problem. I'd like to submit a pull request for this, but I'm not sure this approach would be accepted. Any advice?
If the binstubs are generated by bundler, that is bundler's responsibility. They should ship their own little bash script that detects .bundle and adds bin/ to PATH.
Actually, rubygems-bundler replaces the need for generate binstubs or using bundle exec. Just tested it on a project and it works perfectly with chruby.
After talking to @wycatz, he actually recommends explicitly running ./bin/rake or bundle exec rake. This forces the user to choose whether they want to run system rake or bundled rake. A common case for this is bootstrapping a project via rake setup. However, most people will avoid the extra typing by dangerously adding ./bin to $PATH or using a bundler plugin (rubygems-bundler, rbenv-bundler or rbenv-binstubs).
It's interesting that rails now respect binstubs (tried with Rails 5.0.0.1). It might be slightly less dangerous to allow only a whitelist in ./bin (such as rails, rake and puma) so that important binaries like less and cat won't be overrided.
Note: I am not using Bundler's binstubs, but Spring's. This functionality is not covered by bundle exec.
Activity
postmodern commentedon Mar 8, 2013
If the binstubs are generated by bundler, that is bundler's responsibility. They should ship their own little bash script that detects
.bundleand addsbin/toPATH.postmodern commentedon Apr 17, 2013
Actually, rubygems-bundler replaces the need for generate binstubs or using
bundle exec. Just tested it on a project and it works perfectly with chruby.postmodern commentedon Apr 17, 2013
After talking to @wycatz, he actually recommends explicitly running
./bin/rakeorbundle exec rake. This forces the user to choose whether they want to run systemrakeor bundledrake. A common case for this is bootstrapping a project viarake setup. However, most people will avoid the extra typing by dangerously adding./binto$PATHor using a bundler plugin (rubygems-bundler, rbenv-bundler or rbenv-binstubs).FranklinYu commentedon Sep 6, 2016
It's interesting that
railsnow respect binstubs (tried with Rails 5.0.0.1). It might be slightly less dangerous to allow only a whitelist in./bin(such asrails,rakeandpuma) so that important binaries likelessandcatwon't be overrided.Note: I am not using Bundler's binstubs, but Spring's. This functionality is not covered by
bundle exec.