How do I tell Unicorn to run Rails using "bundle exec"? -


i'm running unicorn rails 5 on ubuntu 14.04. i'm running unicorn daemon, using script, /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; 

in separate file, /etc/default/unicorn, have daemon , unicorn_opts variable defined ...

unicorn_opts="-d -c $config_rb -e $rails_env" ... daemon="$gem_path/bin/unicorn" 

my quesiton is, how tell unicorn when runs rails prefix "bundle exec"? need bundle exec because i'm getting these complaints in unicorn log complaining gem versions , how bundle exec save teh day.

bundle needs run directory of app root.

your daemon should cd $app_root && $gem_path/bin/bundle exec unicorn


Comments