LoginSignup
0
0

More than 3 years have passed since last update.

[Rails]使用中のlocalhost3000のプロセスを切る

Posted at

最近の勉強で学んだ事を、ノート代わりにまとめていきます。
主に自分の学習の流れを振り返りで残す形なので色々、省いてます。
Webエンジニアの諸先輩方からアドバイスやご指摘を頂けたらありがたいです!

localhost:3000で別のサーバーを起動したい

localhost:3000でサーバーを起動しようとしたら別のRailsのプロジェクトで使用していたのを忘れていました。

$ rails s
/Users/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/app_loader.rb:53: warning: Insecure world writable dir /Users in PATH, mode 040777
=> Booting Puma
=> Rails 5.2.3 application starting in development 
=> Run `rails server -h` for more startup options
A server is already running. Check /Users/Desktop/project/tmp/pids/server.pid.
Exiting

3000のポートを使用している物を確認!

sudo lsof -nP -iTCP:3000 -sTCP:LISTEN
COMMAND   PID             USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    40429 tester.user        29u  IPv4 0xbed1da96d5b6b725      0t0  TCP *:3000 (LISTEN)
ruby    70168 tester.user        12u  IPv4 0xbed1da96d2fa3425      0t0  TCP 127.0.0.1:3000 (LISTEN)
ruby    70168 tester.user        13u  IPv6 0xbed1da96b93aa9e5      0t0  TCP [::1]:3000 (LISTEN)

プロセス番号(PID)を指定してプロセスを切る

kill -9 70168

これで完了!

参考記事

Rails sのプロセスが切れない時
Killing MailCatcher: Something's using port 1025

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0