ruby on rails - difference between running rake command with and without bundle exec -
what major difference between running rake command , without bundle exec?
i have seen few posts stated when run command bundle exec run on scope of gems version defined in gem file. if case, should mandatory run rake command 'bundle exec' ??
bundle exec rake some:task
runs rake task within context of bundle.
you didn't explicitly mention rails see you're post tagged rails contrived example of in action might following:
you have version 2.0 of fictitious whateva-whateva
gem installed on system valid reason.
you decide want pull down old rails project somewhere check out , run bundle install
within cloned project's root folder. command install of gems rails app requires , 1 of them happens verison 1.0 of fictitious whateva-whateva
gem.
so current state this: old rails app has gem bundle includes older version of whateva-whateva
, systemwide gems include newer version of whateva-whateva
gem.
when run rake tasks associated rails app, version want loaded? older 1 of course.
in order can use bundle exec rake the:task
, runs rake command within context of bundle -- older version of gem plus whatever other stuff specified in old rails app's gemfile.
so yeah after that, think it's safe best practice should prepend bundle exec
honest i'm pretty lazy , unless see problems.
in other news, if use bundler's binstubs don't need add it. here's link setting up: http://robots.thoughtbot.com/post/15346721484/use-bundlers-binstubs
Comments
Post a Comment