2012-12-24 158 views
22

是做什么的区别:'bundle exec rake'与rake有什么区别?

bundle exec rake 

rake 

我看到人们在这两个,我从来不做bundle我的命令之前,好奇其原因是什么?

+2

我认为这个http://stackoverflow.com/questions/6588674/what-does-bundle-exec-rake-dbmigrate-mean可以有答案 – Khaled

+0

重复:http: //stackoverflow.com/questions/6588674/what-does-bundle-exec-rake-mean –

回答

18

bundle exec在bundle的上下文中执行命令。 该命令执行该命令,使得在Ruby程序中可以使用Gemfile中指定的所有宝石。 当你有很多应用程序使用不同版本的宝石时非常有用。 请参阅文档以获取更多信息:http://gembundler.com/man/bundle-exec.1.html

9

bundle exec在Bundler的环境中运行命令后。所以说你已经在你的Gemfile中耙0.9,但是在RubyGems中安装了耙10。 bundle exec rake将运行耙0.9而不是耙10。

相关问题