LoginSignup
38
43

More than 5 years have passed since last update.

rails server -d でバックグラウンドで実行中のプロセスを停止する方法

Posted at

開発環境ではrails serverのコマンドを使ってWEBRickのサーバーを立ち上げています。
動かしっぱなしにしたいときは-dのオプションで
rails server -d
とすることで、バックグラウンドで実行できます。

これは非常に便利なのですがサーバーを再起動したい時にちょっと困りました。
解決策をメモしておきます。
ps ax | grep rails
を実行すると、
11940 ? Sl 1:52 /root/.rbenv/versions/2.0.0-p598/bin/ruby bin/rails s -d
こんな感じの行があるので
kill -9 11940
とすればOKです

この記事を参考にしました。ありがとうございます。
http://qiita.com/dala/items/f5114cfb9ba3b0631bc0

38
43
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
38
43