【发布时间】:2017-04-05 23:45:33
【问题描述】:
我在 Ubuntu 14.04 上使用 Rails 5 运行 Unicorn。我正在运行 Unicorn 作为守护进程,使用脚本 /etc/init.d/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 中,我定义了 DAEMON 和 UNICORN_OPTS 变量...
UNICORN_OPTS="-D -c $CONFIG_RB -E $RAILS_ENV"
...
DAEMON="$GEM_PATH/bin/unicorn"
我的问题是,我如何告诉 Unicorn 在运行 rails 时为其添加“bundle exec”前缀?我需要 bundle exec,因为我在我的独角兽日志中收到了所有这些抱怨,抱怨 gem 版本以及 bundle exec 将如何节省时间。
【问题讨论】:
标签: ruby-on-rails exec bundle ruby-on-rails-5 unicorn