Rails: Killing a Rouge Webrick Server

If you have ever accidentally closed a terminal window which was running your Rails Webrick server and the server continued to run in the background but you need to kill it so you can restart a new instance you can do the following:

1. run the lsof command identifying port 3000 as the target to get the process ID of the rouge Webrick server

lsof -i:3000

2. then use the kill command plus the process ID you got from step 1 and your rouge will be taken care of.

kill process_id

Of course this is just one way to handle it, if anyone has a better way please comment and let the rest of us know. Thanks in advance!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s