Skip to content

Instantly share code, notes, and snippets.

@eknowlton
Created May 16, 2018 20:17
Show Gist options
  • Save eknowlton/163dda2f886a50c28f6dc99078ca188c to your computer and use it in GitHub Desktop.
Save eknowlton/163dda2f886a50c28f6dc99078ca188c to your computer and use it in GitHub Desktop.
Rails 5 Server Script, with rbenv
#!/usr/bin/env bash
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
path="$(dirname `pwd`)"
if [ -f ../puma.pid ]; then
kill -9 $(cat "../puma.pid")
rm -rf ../puma.pid
fi
if [ -f ../puma.sock ]; then
rm -rf ../puma.sock
fi
bundle exec puma -e production -b "unix://$path/puma.sock" --pidfile "$path/puma.pid" -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment