What does 'bundle exec rake' versus rake do?

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.


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