I am new to rails and I am using an ubuntu machine and the rubymine IDE. The problem is that I am unable to stop the rails server. I tried to stop the server by killing the
It is late for this question. Here is my 2 cents. I made a rake task for stopping the server when I don't have access to it. I only tested on Mac though.
With this you can simply add it to your project then run the rake command.
Here you go:
Gist link: -latest version will be here. https://gist.github.com/houmanka/289184ca5d8d92de0499#file-server-rake
Some code in here:
# Make a file under: `project_root/lib/tasks/server.rake`
# Then paste the following code
namespace :server do
desc "Stop the running server by killing the PID"
task :kill do
STDOUT.puts "Enter port number: "
post_number = STDIN.gets.strip
system "pid=$(lsof -i:#{post_number.to_i} -t); kill -TERM $pid || kill -KILL $pid"
end
end
# Then to use it in the terminal: `rake server:kill`