Search code examples
ruby-on-railsamazon-web-servicesidecloud9-ide

Stop Rails server in new AWS Cloud 9 IDE


I am just starting to learn Rails in the new AWS Cloud 9 on a Mac and I cannot stop the Rails server. The instructions say to use Control+c but in the Cloud9 terminal with Rails running this just writes:

^[c

...and then creates a new line and does nothing.

I have also tried killall -9 rails but this just writes it in the terminal and again creates a new line but does nothing. Any help here please? Here is what my Cloud 9 terminal currently looks like:

ec2-user:~/ruby_projects (master) $ rails s -b $IP -p $PORT
=> Booting Puma
=> Rails 5.2.1 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.4.1-p111), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:8080
Use Ctrl-C to stop
^[c
c

^[c
killall -9 rails

Solution

  • If Control + C doesn't do the trick then just close the terminal and that should kill all ongoing processes in that terminal.

    You can verify that it killed it by running ps aux | grep "rails" and then checking if there are any entries. If there is one find the process ID and then kill it (or you could just kill it with ps aux | grep -ie rails | awk '{print $2}' | xargs kill -9).