Reputation: 267240
What is the difference between doing:
bundle exec rake
and
rake
I see people doing both, I never do bundle
before my commands, curious what the reason for it is?
Upvotes: 27
Views: 5762
Reputation: 2016
bundle exec
executes a command in the context of the bundle.
This command executes the command, making all gems specified in the Gemfile
available to require in Ruby programs.
Very useful when you have many applications with different versions of gems used
in them.
Please see docs for more information: http://gembundler.com/man/bundle-exec.1.html
Upvotes: 22
Reputation: 653
bundle exec
runs the command after it in the environment of Bundler. So say you had rake 0.9 in you Gemfile, but rake 10 installed in RubyGems.bundle exec rake
will run rake 0.9 instead of rake 10.
Upvotes: 15