Domanda

Recentemente ho istituito un cedro (Rails 3.1) app su Heroku, e di eseguire, ad esempio, la migrazione, si farebbe

heroku run rake db:migrate

Ho imparato che è buona norma usare "exec fascio" prima di qualsiasi comando rake (come dice Katz http://yehudakatz.com / ). Così, ho pensato che forse il seguente è effettivamente migliore pratica:

heroku run bundle exec rake db:migrate

Ma per ridurre il livello di dettaglio, è bene per utilizzare l'ex di comando, o è quella con fascio exec critico?

È stato utile?

Soluzione

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.

Altri suggerimenti

"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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top