I know there’s more than one extension for bundle Install, but what exactly does:
bundle install --binstubs
do compared to a normal
bundle install
?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure what you mean by extensions in this context, but the difference is that
bundle install --binstubscreates a./bindirectory, and places links in that directory to any binaries your gems install. For example, the rspec gem comes with anrspecbinary. In order to make sure the proper version of RSpec is run when you type it at the command line, you can place the project-specificbindirectory in your shell’s executable search path.The problem Bundler is trying to solve here is that you can install multiple versions of a gem (like rspec), and your shell needs a way to find the right version to execute. One solution is using
--binstubsand altering your PATH to include it at the beginning (either the relative path, which isn’t the best idea in the world, or the absolute path, which you’d have to configure for each project).Alternatives to
--binstubsare to prefix all gem commands withbundle exec(likebundle exec rspec), to ensure that the appropriate version is run based on your project’s Gemfile, or to use RVM and gemsets.It’s all a bit complicated, and the Bundler documentation is pretty terrible when it comes to explaining this.