{"id":233,"date":"2020-10-01T14:58:21","date_gmt":"2020-10-01T05:58:21","guid":{"rendered":"https:\/\/tech.aoiblog.net\/?p=233"},"modified":"2020-10-02T12:20:58","modified_gmt":"2020-10-02T03:20:58","slug":"a-server-is-already-running%e3%81%8c%e5%87%ba%e3%81%9f%e6%99%82%e3%81%ae%e5%af%be%e5%87%a6%e6%b3%95","status":"publish","type":"post","link":"https:\/\/tech.aoiblog.net\/?p=233","title":{"rendered":"A server is already running\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"\n<p>\u3044\u3064\u3082\u901a\u308a<code>rails s<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068<\/p>\n\n\n\n<p><strong>A server is already running<\/strong><\/p>\n\n\n\n<p>\u3068\u30a8\u30e9\u30fc\u3089\u3057\u304d\u3082\u306e\u304c\u51fa\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30a8\u30e9\u30fc\u3055\u3093\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3057\u305f\uff01\uff01<br>\u4eca\u65e5\u306f\u3053\u308c\u3092\u79d2\u901f\u3067\u89e3\u6c7a\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u301c\u3002<\/p>\n\n\n\n<h2 class=\"m\">A server is already running\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>A server is already running. Check C:\/rails\/devise\/tmp\/pids\/server.pid.\nExiting<\/code><\/pre>\n\n\n\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u51fa\u3066\u307e\u3059\u3002<br>\u304a\u305d\u3089\u304f\u539f\u56e0\u306f\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3061\u4e0a\u3052\u305f\u307e\u307e\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u5207\u3063\u3066\u3057\u307e\u3063\u305f\u304b\u3089\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u89e3\u6c7a\u65b9\u6cd5\u306f2\u3064\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"m\">1.\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u518d\u8d77\u52d5<\/h3>\n\n\n\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u2318 + Q\u3067\u9589\u3058\u3066\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u5f8c\u3001\u3082\u3046\u4e00\u5ea6\u958b\u3044\u3066rails s\u3092\u5b9f\u884c\u3059\u308b\u3068\u76f4\u3063\u3066\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u307e\u305f\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3089\u4ee5\u4e0b\u306e\u65b9\u6cd5\u3092\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"m\">2.server.pid\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><code>rails\u30a2\u30d7\u30ea\u30d5\u30a9\u30eb\u30c0\/tmp\/pids\/server.pid<\/code><\/p>\n\n\n\n<p>\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u3059\u308b\u969b\u306b\u4f5c\u3089\u308c\u308b\u30d5\u30a1\u30a4\u30eb\u3060\u305d\u3046\u3002<br>\u672c\u6765\u306f\u30b5\u30fc\u30d0\u30fc\u7d42\u4e86\u6642\u306b\u524a\u9664\u3055\u308c\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u6642\u306f\u307e\u3060\u6b8b\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u304a\u305d\u3089\u304f\u30b5\u30fc\u30d0\u30fc\u3092\u505c\u6b62\u3059\u308b\u524d\u306b\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u9589\u3058\u3066\u3057\u307e\u3063\u305f\u304b\u3089\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u30d5\u30a1\u30a4\u30eb\u304c\u6b8b\u3063\u3066\u3044\u305f\u3089\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>\u3053\u308c\u3067\u76f4\u308b\u65b9\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u50d5\u306f\u307e\u3060\u76f4\u308a\u307e\u305b\u3093\u3067\u3057\u305f\uff01&#x1f62d;<br>\u540c\u3058\u3088\u3046\u306a\u4eba\u306f\u4ee5\u4e0b\u3092\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044<\/p>\n\n\n\n<h3 class=\"m\">3.lsof -i :3000<\/h3>\n\n\n\n<p>\u3082\u3046\u4e00\u56derails s \u3092\u8d77\u52d5\u3059\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u65b9\u5411\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Address already in use - bind(2) for \"127.0.0.1\" port 3000 (Errno::EADDRINUSE)<\/code><\/pre>\n\n\n\n<p>3000\u756a\u306f\u65e2\u306b\u4f7f\u308f\u308c\u3066\u3044\u308b\u3068\u306e\u3053\u3068\u3002<br>\u306a\u306e\u3067\u30013000\u756a\u306e\u63a5\u7d9a\u3092\u5207\u3063\u3066\u3042\u3052\u308c\u3070\u30aa\u30c3\u30b1\u30fc\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsof -i :3000<\/code><\/pre>\n\n\n\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u4e0a\u3067\u4e0a\u8a18\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u3059\u308b\u3068\u4f55\u500b\u304bPID\u304c\u51fa\u3066\u304f\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u305d\u306ePID\u3092\u6d88\u3057\u3066\u3042\u3052\u308c\u3070\u826f\u3044\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kill -QUIT PID<\/code><\/pre>\n\n\n\n<p>PID\u306e\u90e8\u5206\u306f\u3054\u81ea\u8eab\u306e\u6570\u5b57\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002<br>\u50d5\u306e\u5834\u5408\u306fPID\u304c\u300c8216\u300d\u3067\u3057\u305f\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kill -QUIT 8216<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3057\u3066\u304b\u3089\u518d\u3073<code>rails s<\/code>\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3044\u3064\u3082\u901a\u308arails s\u3092\u5b9f\u884c\u3059\u308b\u3068 A server is already running \u3068\u30a8\u30e9\u30fc\u3089\u3057\u304d\u3082\u306e\u304c\u51fa\u307e\u3057\u305f\u3002 \u30a8\u30e9\u30fc\u3055\u3093\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3057\u305f\uff01\uff01\u4eca\u65e5\u306f\u3053\u308c\u3092\u79d2\u901f\u3067\u89e3\u6c7a\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u301c\u3002 A server  &#8230; <\/p>\n","protected":false},"author":1,"featured_media":102,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts\/233"}],"collection":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233"}],"version-history":[{"count":2,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts\/233\/revisions"}],"predecessor-version":[{"id":235,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts\/233\/revisions\/235"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/media\/102"}],"wp:attachment":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}