如何告诉独角兽使用"bundle exec"运行 Rails?



我在 Ubuntu 14.04 上运行带有 Rails 5 的 Unicorn。 我正在使用脚本/etc/init.d/unicorn 将 Unicorn 作为守护进程运行,

case "$1" in
  start)
        check_config
        check_app_root
        log_daemon_msg "Starting $DESC" $NAME || true
        if start-stop-daemon --start --quiet --oknodo --pidfile $PID --exec $DAEMON -- $UNICORN_OPTS; then

在一个单独的文件中,/etc/default/unicorn,我定义了守护程序和UNICORN_OPTS变量......

UNICORN_OPTS="-D -c $CONFIG_RB -E $RAILS_ENV"
...
DAEMON="$GEM_PATH/bin/unicorn"

我的问题是,我如何告诉独角兽,当它运行轨道时,用"捆绑执行"作为前缀? 我需要捆绑执行,因为我在我的独角兽日志中收到所有这些抱怨,抱怨宝石版本以及捆绑执行将如何挽救这一天。

捆绑包需要从应用程序根目录运行。

您的DAEMON应该看起来像cd $APP_ROOT && $GEM_PATH/bin/bundle exec unicorn

最新更新