Question

I recently set up a Cedar (Rails 3.1) app on Heroku, and to run, for example, a migration, you'd do

heroku run rake db:migrate

I learned that it's good practice to use "bundle exec" before any rake command (as Katz says http://yehudakatz.com/). So, I thought perhaps the following is actually better practice:

heroku run bundle exec rake db:migrate

But to reduce verbosity, is it alright to use the former command, or is the one with bundle exec critical?

Was it helpful?

Solution

On Heroku when the slug is compiled the Gems are installed from into a clean slug as specified in your Gemfile so there's not going to be extraneous Gems floating around the place - there's no need to use bundle exec on Heroku - else I'm sure the Heroku documentation would tell you to do it.

OTHER TIPS

"In some cases, running executables without bundle exec may work, if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle. However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine"

Quoting from bundler's Documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top