How do you restart the rails server? I started it with
rails server -d
So the server is detached
The only way i know is to do ps aux | grep rails and kill -9 on the process # But is it good to kill processes like this?
Is there any command in rails that is supposed to be used for stopping or restarting the server?
Thanks!
Killing the detached server should have no negative consequences (given that there is nobody trying to reach the server). If there is still data that was not persisted however (e.g. from Active Directory caches) you would lose that, of course. If you encounter that problem more often, you may want to think about creating a rake task that will stop the server for you. As an alternative to
ps aux | grep ...
you could also use
lsof -i :[port]
where [port] is the port on which the server is running (default: 3000)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With