Bundler

Binstubs

Favor project binstubs instead of using bundle exec PROGRAM. Binstubs will ensure
that bundler/setup is required before executing the program instead of running
it through Kernel.exec call.

Instead of generating stubs for all dependencies in your project with bundle install --binstubs,
you can use bundle binstub [GEMS...] to generate only stubs of gems you know
you will use, and delete any extra files that you won’t be using:

$ bundle binstub rspec-core capistrano
# Capistrano 3 ships with 'capify', but we only need `bin/cap`.$ rm bin/capify
# We can now use 'bin/cap' or 'bin/rspec'.

Important: Rails 4.0+ already ships with binstubs for the rails and rake
executables so you don’t need to generate them by yourself.

For more explanations around binstubs, please see thes rbenv Wiki’s page on binstubs.

Gemfile

For gems that don’t follow a strict versioning scheme(like Semantic Versioning),
prefer to lock their entire version on the Gemfile.

Use the pessimistic operator for gems that are more unlikely to break backwards compatibility between minor or patch releases.

Watch for gem updates regularly to avoid having to update multiple gems at once. You can run bundle outdated once a week and attempt to update gems that have recent releases and prevent having a largely outdated app.

Make one commit per gem updated so you avoid big changes all at once. It helps investigating possible breaks or bugs on your project. It’s also easier to revert a commit that revolves around one goal and rollback the update.