Skip to content

Instantly share code, notes, and snippets.

@SeanRoberts
Created September 20, 2016 13:14
Show Gist options
  • Save SeanRoberts/154386dc5904db4fd58463068b9dbc8d to your computer and use it in GitHub Desktop.
Save SeanRoberts/154386dc5904db4fd58463068b9dbc8d to your computer and use it in GitHub Desktop.
Upstart script for delayed job using rbenv and bundle exec
start on runlevel [2345]
stop on runlevel [06]
setuid YOUR_USER
setgid YOUR_USER
env HOME=/home/YOUR_USER
env RAILS_ENV=production
env PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:/usr/local/bin:/usr/bin:/bin
chdir /path/to/your/app
exec $HOME/.rbenv/bin/rbenv shell 2.1.0
exec $HOME/.rbenv/shims/bundle exec rake jobs:work RAILS_ENV=production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment