0

I am trying to stop rails server from my console (i am using ubuntu) so following the related questions on stack, I tried

Ctrl + C
pgrep -l ruby and then kill -9 $the_right_pids (and also ps aux | grep ...)

but none of these worked. Does anybody have an idea ?

Update: I found a solution on a stack post and the issue seems be come from a ruby server bug (when using rubymine?), the solution seems not natural but it can do the trick : stop the process in the console and the refresh the browser with another localhost's port --> How to stop/kill server (development) in rubymine

Community
  • 1
  • 1
epsilones
  • 11,279
  • 21
  • 61
  • 85
  • First, are you root (e.g. `sudo -s`) when doing the `kill` ? Then try first `kill -TERM $pid` then `kill -QUIT $pid` and at last `kill -KILL $pid` .... – Basile Starynkevitch Feb 23 '13 at 13:02
  • Another possibility is probably `/etc/init.d/rails stop` (or some other `rails` related script under `/etc/init.d`) – Basile Starynkevitch Feb 23 '13 at 13:05
  • @BasileStarynkevitch Sorry, I updated my post (because pgrep -l rails shows nothing, instead of pgrep -l ruby). Btw, sure I am root when I run the kill process. I am going to try what you advide me – epsilones Feb 23 '13 at 13:05
  • @BasileStarynkevitch, in fact I have no rails-like stuff in /etc/init.d, perhaps because the gem install nothing there (?) – epsilones Feb 23 '13 at 13:08
  • @BasileStarynkevitch, I tried the different commands but it didn't work and quite strangely I get nothing specific to rails when I try to 'grep rails' after calling 'ps aux' – epsilones Feb 23 '13 at 13:11
  • You should know how is your rail program started.... – Basile Starynkevitch Feb 23 '13 at 13:14
  • @BasileStarynkevitch I run it with ./script/server start – epsilones Feb 23 '13 at 13:16
  • Then you need to run `./script/server stop` to stop it – Basile Starynkevitch Feb 23 '13 at 13:20
  • @BasileStarynkevitch I also tried lsof -i:3000 since rails is running on this port, I killed the process, but rails is still running ?? – epsilones Feb 23 '13 at 13:20
  • @BasileStarynkevitch no even with this command, it is still running, what a weird thing ! – epsilones Feb 23 '13 at 13:26
  • @BasileStarynkevitch : I found a solution in on a stack post because the issue seems be come from a ruby server bug (when using rubymine?), it seems not natural but it can do the trick : stop the process in the console and the refresh the browser with another port --> http://stackoverflow.com/questions/6525488/how-to-stop-kill-server-development-in-rubymine – epsilones Feb 23 '13 at 13:41

0 Answers0