sample.service file
you have to copy it to
/etc/systemd/system
sudo systemctl enable sample.service
sudo journalctl -u sample.service
sudo journalctl -u sample.service -f # to tail it
[Unit]
Description=Sample Service process
[Service]
WorkingDirectory=/home/app/code
Environment=LANG=en_US.UTF-8
Environment=LC_ALL=en_US.UTF-8
User=app
ExecStart=/home/app/.rbenv/shims/bundle exec "rake sample:worker"
Restart=on-failure
TimeoutStartSec=90
[Install]
WantedBy=multi-user.target