与heroku捆绑执行 - 是否有必要? [英] bundle exec with heroku - is it necessary?

查看:200
本文介绍了与heroku捆绑执行 - 是否有必要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Heroku上设置了一个Cedar(Rails 3.1)应用程序,并且运行一个迁移程序,你可以这样做:

  heroku run rake db:migrate 

我知道使用bundle在任何rake命令之前执行(如Katz说的 http://yehudakatz.com/ )。所以,我想也许下面是更好的做法:

  heroku run bundle exec rake db:migrate 

code>

但为了减少冗长,可以使用前一个命令,还是使用bundle exec临界值??

解决方案

在编译slu the的Heroku中,Gem会根据您的Gemfile中的指定安装成一个干净的slu so,所以不会有无关的Gems漂浮在这个地方 - 不需要在Heroku上使用bundle exec - 否则我确信Heroku文档会告诉你这么做。

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?

解决方案

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.

这篇关于与heroku捆绑执行 - 是否有必要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆