RVM wrapper + instructions to boot puma web server on correct environment without unwanted encounters
- add the script to correct location
/usr/local/bin/puma_wrapper/start_puma.sh
- make it executable
sudo chmod +x /usr/local/bin/puma_wrapper/start_puma.sh
- go to sys daemon
sudo nano /etc/systemd/system/puma.service
- it should look something like this (make sure user groups and paths are correct)
[Unit]
Description=Puma HTTP Server
After=network.target
[Service]
User=puma
Group=puma
WorkingDirectory=/var/www/my-app
ExecStart=/usr/local/bin/puma_wrapper/start_puma.sh
Restart=always
[Install]
WantedBy=multi-user.target
- reload systemd and puma service
sudo systemctl daemon-reload
sudo systemctl restart puma
sudo systemctl status puma
- verify that there are no errors
sudo systemctl status puma
- make sure to allow traffic on correct port
sudo ufw status
sudo ufw allow your_port_number
sudo ufw reload
- ADDITIONAL: debugging potential errors:
journalctl -u puma.service
# check nginx / apache error logs
sudo tail -f /var/log/nginx/error.log