How to restart Rails from within Rails?
问题 Ok, so I would like to create an action in Rails to restart itself. I did a little searching and found: http://snippets.dzone.com/posts/show/5002 Which suggests 2 commands, one to stop and another to restart. The following kills: ps -a|grep "/usr/local/bin/ruby script/server"|grep -v "grep /usr"|cut -d " " -f1|xargs -n 1 kill -KILL $1 The -HUP signal doesn't restart for me, so I tried to mangle the above command (adjusted so the command worked fine with how I was starting the server under