bundler: Don't generate binstubs by default when using Rails 4?
When using Rails 4, the default options result in this error being raised when running a command from bin in a deployed environment:
Looks like your app's ./bin/rails is a stub that was generated by Bundler.
In Rails 4, your app's bin/ directory contains executables that are versioned
like any other source code, rather than stubs that are generated on demand.
Here's how to upgrade:
bundle config --delete bin # Turn off Bundler's stub generator
rake rails:update:bin # Use the new Rails 4 executables
git add bin # Add bin/ to source control
You may need to remove bin/ from your .gitignore as well.
When you install a gem whose executable you want to use in your app,
generate it and add it to source control:
bundle binstubs some-gem-name
git add bin/new-executable
I have in fact checked in a bin with executables generated by Rails, but they are not used, because by default bin is symlinked to shared/bin, containing executables with bundler-generated executables. Of course it is trivial to configure bundler such that this doesn’t happen, but since everyone using Rails 4 needs to do that, it would be better to just do ‘the right thing’ out of the box.
Do you agree and are you interested in a pull request for this?
Edit: Also see https://github.com/rails/rails/issues/8974 and specifically https://github.com/rails/rails/issues/8974#issuecomment-22993215
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 4
- Comments: 43 (8 by maintainers)
Commits related to this issue
- Don't generate binstubs by default when using Rails 4 - See https://github.com/capistrano/bundler/issues/45 — committed to GSA/asis by loren 10 years ago
- Do not make `bin/` shared directory by default 1) bin/ is often checked out into repo 2) https://github.com/capistrano/bundler/issues/45#issuecomment-69349237 — committed to kirs/capistrano by kirs 9 years ago
- Do not suggest `bin/` to be shared directory by default 1) bin/ is often checked out into repo 2) https://github.com/capistrano/bundler/issues/45#issuecomment-69349237 — committed to kirs/capistrano by kirs 9 years ago
- Do not suggest `bin/` to be shared directory by default 1) bin/ is often checked out into repo 2) https://github.com/capistrano/bundler/issues/45#issuecomment-69349237 — committed to kirs/capistrano by kirs 9 years ago
- Don’t generate binstubs by default Two reasons: 1) `bin/` is often checked out into repo 2) https://github.com/capistrano/bundler/issues/45#issuecomment-69349237 — committed to capistrano/bundler by kirs 9 years ago
- feat(): remove bin from the default linked dirs https://github.com/capistrano/bundler/issues/45 — committed to platanus/negroku by blackjid 9 years ago
- Fixed a Capistrano bug https://github.com/capistrano/bundler/issues/45 — committed to c-brooks/sportsello by c-brooks 8 years ago
- Removed /bin from linked directories https://github.com/capistrano/bundler/issues/45 — committed to NUBIC/CRR by ybushmanova 9 years ago
- Removed /bin from linked directories https://github.com/capistrano/bundler/issues/45 — committed to NUBIC/CRR by ybushmanova 9 years ago
- Do not suggest `bin/` to be shared directory by default 1) bin/ is often checked out into repo 2) https://github.com/capistrano/bundler/issues/45#issuecomment-69349237 — committed to mikejohn857/angular-capistrano-project by mikejohn857 9 years ago
- Do not suggest `bin/` to be shared directory by default 1) bin/ is often checked out into repo 2) https://github.com/capistrano/bundler/issues/45#issuecomment-69349237 — committed to dazralsky/capistrano by kirs 9 years ago
My solution for now… In
config/deploy.rbfile:set :bundle_binstubs, nilbinfrom linked dirsset :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}