Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't stop rails server with CTRL-C

I'm new to Ruby and Rails. I start the WEBrick Server from scripts/server (via ./scripts/server from the directory created by rails) on Debian. The Server starts and is reachable, but if I press CTRL + C then appears

ERROR SystemExit: exit
    [rails dir]/vendor/rails/railties/lib/commands/server.rb:106:in `exit'

and the Server won't stop. What goes wrong?

like image 346
criztovyl Avatar asked Oct 03 '13 01:10

criztovyl


2 Answers

*nix

First step, lookup the process ID (PID) of rails server; you'll need the port it's running on.

Second step, manually kill the process using the PID obtained in step one.

sudo lsof -i tcp:<PORT> # e.g. 3000

kill -9 <PID> # e.g. 14319
like image 56
Mark Evans Avatar answered Oct 25 '22 16:10

Mark Evans


For any latecomers, Rails 2.3.8 doesn't like Rack 1.2.1

Add gem 'rack', '1.1.0' to your gemfile, run bundle update rack and your server should exit correctly.

like image 2
Matt Avatar answered Oct 25 '22 18:10

Matt