Skip to content

Instantly share code, notes, and snippets.

@willwnekowicz
Last active August 29, 2015 13:57
Show Gist options
  • Save willwnekowicz/9751778 to your computer and use it in GitHub Desktop.
Save willwnekowicz/9751778 to your computer and use it in GitHub Desktop.
ZSH Script to Kill Rails Server process and restart it. Type 'k' instead of running 'lsof -wni tcp:3000', looking at the PID and running 'kill -9 <<PID>>', then finally 'rails s' again. Install this plugin under .oh-my-zsh > custom > plugins. Use this to resolve the following error: *A server is already running. Check /pids/server.pid. Exiting*
k(){
kill -9 $(lsof -wni tcp:3000 -t);
rails s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment