How to connect to the WEBrick server

I started the server in a separate mode (-d), how can I connect to it so that I can kill the server).

+6
source share
3 answers

You can see the ruby ​​process id:

ps aux | grep ruby username 17731 0.1 1.6 3127008 67996 ?? S 2:00PM 0:01.42 /Users/username/.rvm/rubies/ruby-1.9.2-p180/bin/ruby script/rails s -d 

and kill the process by id:

 kill -9 17731 
+8
source

You can use pgrep ruby with kill -9 :

 kill -9 `pgrep ruby` 
+5
source

Another way:

 kill -9 `cat tmp/pids/server.pid` 
+4
source

Source: https://habr.com/ru/post/897132/


All Articles