Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7165

How to set ExecStart for Puma service for a Rails app (rvm)?

$
0
0

I am trying to properly configure the setup of my puma service, but still unsuccessfully. My nginx.conf looks like this:

upstream puma {  server unix:///home/rails/myapps/myproj/shared/tmp/sockets/myproj-puma.sock;}server {  listen 80 default_server deferred;  # server_name example.com;  root /home/rails/myapps/myproj/current/public;  access_log /home/rails/myapps/myproj/current/log/nginx.access.log;  error_log /home/rails/myapps/myproj/current/log/nginx.error.log info;  location ^~ /assets/ {    gzip_static on;    expires max;    add_header Cache-Control public;  }  try_files $uri/index.html $uri @puma;  location @puma {    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_set_header Host $http_host;    proxy_redirect off;    proxy_pass http://puma;  }  error_page 500 502 503 504 /500.html;  client_max_body_size 10M;  keepalive_timeout 10;}

The file /home/rails/myapps/myproj/shared/tmp/sockets/myproj-puma.sock doesn't exist, the directory is empty.

In the myproj_puma_production.service is the following content:

[Unit]Description=redata-app#Requires=network.target[Service]Type=simpleUser=rails#Group=rails#WorkingDirectory=/home/rails/myapps/myproj/WorkingDirectory=/home/rails/myapps/myproj/#ExecStart=/usr/share/rvm/bin/rvm all do bundle exec puma -b tcp://0.0.0.0:3000 -e production#ExecStart=/usr/share/rvm/rubies/ruby-3.2.2/bin/bundle exec puma -C /home/rails/myapps/myproj/current/config/puma.rbExecStart=/usr/share/rvm/rubies/ruby-3.2.2/bin exec puma -C /home/rails/myapps/myproj/current/config/puma.rbTimeoutSec=30sRestartSec=30sRestart=always[Install]WantedBy=multi-user.target

When I run systemctl --user status redata_puma_production, I get the following error referencing to the wrong ExecStart:

● myproj_puma_production.service - myproj-app     Loaded: loaded (/etc/xdg/systemd/user/myproj_puma_production.service; enabled; vendor preset: enabled)     Active: activating (auto-restart) (Result: exit-code) since Mon 2024-04-15 16:06:43 UTC; 25s ago    Process: 122683 ExecStart=/usr/share/rvm/rubies/ruby-3.2.2/bin exec puma -C /home/rails/myapps/myproj/current/config/puma.rb (code=exited, status=216/GROUP)   Main PID: 122683 (code=exited, status=216/GROUP)        CPU: 2ms

I don't know how to properly configure the ExecStart field. I tried to run which puma, but only got an empty output. puma is installed within the Rails app.

What am I missing?


Viewing all articles
Browse latest Browse all 7165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>