{"id":4361,"date":"2014-09-12T01:06:38","date_gmt":"2014-09-11T16:06:38","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=4361"},"modified":"2018-11-14T16:33:51","modified_gmt":"2018-11-14T07:33:51","slug":"rails4-2beta1%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6%e6%9c%80%e5%88%9d%e3%81%ab%e3%81%af%e3%81%be%e3%81%a3%e3%81%9f%e3%81%93%e3%81%a8","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2014\/09\/12\/rails4-2beta1%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6%e6%9c%80%e5%88%9d%e3%81%ab%e3%81%af%e3%81%be%e3%81%a3%e3%81%9f%e3%81%93%e3%81%a8\/","title":{"rendered":"Rails4.2beta1\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u6700\u521d\u306b\u306f\u307e\u3063\u305f\u3053\u3068"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u5bfa\u5ca1\u3067\u3059\u3002<\/p>\n<p>Rails4.2\u306f\u6765\u5e74\u306e\u590f\u306b\u4e88\u5b9a\u3055\u308c\u3066\u3044\u308bRails5.0\u306b\u5411\u3051\u3066\u30014.x\u7cfb\u6700\u5f8c\u306e\u30de\u30a4\u30ca\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306b\u306a\u308b\u305d\u3046\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306fRails4.2beta1\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3068\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u306f\u307e\u308a\u30dd\u30a4\u30f3\u30c8\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u307e\u305a\u306f\u3055\u3089\u3063\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<pre class=\"lang:sh decode:true \">\r\n# rails\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\r\nmkdir rails42\r\ncd rails42\r\n\r\n# Gemfile\u306e\u4f5c\u6210\r\nbundle init\r\n\r\n# Gemfile\u306brails\u3092github\u306emaster\u30d6\u30e9\u30f3\u30c1\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\r\necho 'gem \"rails\", github: \"rails\", branch: :master' >> Gemfile\r\n\r\n# \u30b7\u30b9\u30c6\u30e0\u306egem\u306b\u6df7\u3056\u3089\u306a\u3044\u3088\u3046\u306bvendor\/bundle\u4ee5\u4e0b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\r\nbundle install --path vendor\/bundle\r\n\r\n# \u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08rails42\uff09\u306brails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\r\nbundle exec rails new .\r\n\r\n# \u9014\u4e2dGemfile\u3092\u4e0a\u66f8\u304d\u3059\u308b\u304b\u5c0b\u306d\u3089\u308c\u308b\u306e\u3067\u300cY\u300d\u3067\u4e0a\u66f8\u304d\r\n\u3000Overwrite \/var\/sites\/rails42\/Gemfile? (enter \"h\" for help) [Ynaqdh]\r\n<\/pre>\n<p>rails\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306b\u304b\u306a\u308a\u306e\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u306e\u3067\u6c17\u9577\u306b\u5f85\u3061\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u5f8c\u3001\u304a\u3082\u3080\u308d\u306b\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \">\r\n.\/bin\/rails s\r\n=> Booting WEBrick\r\n=> Rails 4.2.0.beta1 application starting in development on http:\/\/localhost:3000\r\n=> Run `rails server -h` for more startup options\r\n=> Ctrl-C to shutdown server\r\n[2014-09-11 11:22:11] INFO  WEBrick 1.3.1\r\n[2014-09-11 11:22:11] INFO  ruby 2.1.0 (2013-12-25) [x86_64-linux]\r\n[2014-09-11 11:22:11] INFO  WEBrick::HTTPServer#start: pid=29792 port=3000\r\n<\/pre>\n<p>\u554f\u984c\u306a\u304f\u8d77\u52d5\u3057\u307e\u3057\u305f\u306d\u3002<\/p>\n<h2>\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3057\u305f\u306e\u3060\u304c\u2026<\/h2>\n<p>\u7b46\u8005\u306fWindows\u74b0\u5883\u306bVirtualBox\u4e0a\u306bLinux\u3092\u7acb\u3066\u3066\u958b\u767a\u3059\u308b\u3053\u3068\u304c\u591a\u304f\u3001\u4eca\u56de\u3082\u305d\u306e\u69cb\u6210\u3067\u8a66\u3057\u307e\u3057\u305f\u3002<br \/>\nLinux\u306fCUI\u306e\u307f\u3067\u5229\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30db\u30b9\u30c8\u306eWindows\u74b0\u5883\u304b\u3089<\/p>\n<pre>http:\/\/\u30b2\u30b9\u30c8Linux\u306eIP:3000\/<\/pre>\n<p>\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u3042\u308c\u2026\u63a5\u7d9a\u3067\u304d\u306a\u3044\uff1f<\/p>\n<p>\u306a\u3093\u3068\u306a\u304f\u9583\u304f\u3082\u306e\u304c\u3042\u3063\u305f\u306e\u3067\u3001Linux\u74b0\u5883\u304b\u3089wget\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \">wget http:\/\/localhost:3000\/<\/pre>\n<p>\u3053\u3061\u3089\u306f\u554f\u984c\u306a\u304f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u6b21\u306b\u3001ss\u30b3\u30de\u30f3\u30c9\u3067\u30ea\u30c3\u30b9\u30f3\u30dd\u30fc\u30c8\u3068IP\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \">ss -lnpt | grep 3000\r\nLISTEN   0   128   127.0.0.1:3000   *:*   users:((\"ruby\",29792,9))\r\n<\/pre>\n<p>\u30eb\u30fc\u30d7\u30d0\u30c3\u30af\u30a2\u30c9\u30ec\u30b9\u306e127.0.0.1\u3067listen\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30db\u30b9\u30c8OS\u304b\u3089\u306f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304b\u3063\u305f\u3088\u3046\u3067\u3059\u3002<br \/>\n.\/bin\/rails s\u3067\u8d77\u52d5\u3057\u305f\u30ed\u30b0\u3088\u304f\u3088\u304f\u898b\u308b\u3068\u3001\u300con http:\/\/localhost:3000\u300d\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u8a66\u3057\u306brails4.1\u306e rails s \u3067\u8d77\u52d5\u3057\u3066\u307f\u308b\u3068\u300con http:\/\/0.0.0.0:3000\u300d\u3068\u8868\u793a\u3055\u308c\u3001<br \/>\n0.0.0.0\uff08=\u5168\u3066\u306e\u30a2\u30c9\u30ec\u30b9)\u3067listen\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2>rack\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u304c\u4fee\u6b63\u3055\u308c\u3066\u3044\u305f<\/h2>\n<p>\u3053\u306e\u4fee\u6b63\u306f\u3069\u3053\u3067\u5165\u3063\u305f\u306e\u304b\u3068\u8abf\u3079\u3066\u307f\u308b\u3068\u3001rack\u30d0\u30fc\u30b8\u30e7\u30f31.6\u3067\u306e\u4ed5\u69d8\u5909\u66f4\u306e\u3088\u3046\u3067\u3057\u305f\u3002<br \/>\n<a href=\"https:\/\/github.com\/rack\/rack\/commit\/28b014484a8ac0bbb388e7eaeeef159598ec64fc\">https:\/\/github.com\/rack\/rack\/commit\/28b014484a8ac0bbb388e7eaeeef159598ec64fc<\/a><\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fHost\u30aa\u30d7\u30b7\u30e7\u30f3\u306blocalhost(\u666e\u901a\u306f127.0.0.1)\u304c\u6307\u5b9a\u3055\u308c\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u55ab\u8336\u5e97\u3084\u30ab\u30f3\u30d5\u30a1\u30ec\u30f3\u30b9\u3067\u516c\u8846Wifi\u306b\u7e4b\u3044\u3060\u5834\u5408\u306b\u4e0d\u6b63\u30a2\u30af\u30bb\u30b9\u3055\u308c\u308b\u306e\u3092\u9632\u3050\u306e\u304c\u76ee\u7684\u3060\u305d\u3046\u3067\u3059\u3002<\/p>\n<h2>listen\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3057\u3066\u8d77\u52d5\u3059\u308b<\/h2>\n<p>listen\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u3092\u63a2\u3059\u305f\u3081\u3001rails s \u306ehelp\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \">.\/bin\/rails s --help\r\nUsage: rails server [mongrel, thin, etc] [options]\r\n    -p, --port=port                  Runs Rails on the specified port.\r\n                                     Default: 3000\r\n    -b, --binding=ip                 Binds Rails to the specified ip.\r\n                                     Default: 0.0.0.0\r\n    -c, --config=file                Use custom rackup configuration file\r\n    -d, --daemon                     Make server run as a Daemon.\r\n    -u, --debugger                   Enable the debugger\r\n    -e, --environment=name           Specifies the environment to run this server under (test\/development\/production).\r\n                                     Default: development\r\n    -P, --pid=pid                    Specifies the PID file.\r\n                                     Default: tmp\/pids\/server.pid\r\n\r\n    -h, --help                       Show this help message.\r\n<\/pre>\n<p>\u304a\u3001\u3042\u308a\u307e\u3057\u305f\u306d\u3002<br \/>\n-b \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u8aac\u660e\u304cDefault: 0.0.0.0 \u306b\u306a\u3063\u305f\u307e\u307e\u306a\u306e\u306f\u3054\u611b\u5b0c\u3002<\/p>\n<pre class=\"lang:sh decode:true \">\r\n# \u5168\u3066\u306e\u30a2\u30c9\u30ec\u30b9\u3067listen\u3059\u308b\u3088\u3046\u306b-b 0.0.0.0\u3092\u6307\u5b9a\r\n.\/bin\/rails s -b 0.0.0.0\r\n=> Booting WEBrick\r\n=> Rails 4.2.0.beta1 application starting in development on http:\/\/0.0.0.0:3000\r\n=> Run `rails server -h` for more startup options\r\n=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)\r\n=> Ctrl-C to shutdown server\r\n<\/pre>\n<p>rails4.2\u3084rack1.6\u306f\u307e\u3060\u30d9\u30fc\u30bf\u7248\u306a\u306e\u3067\u3001\u6b63\u5f0f\u7248\u306e\u6642\u70b9\u3067\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u304b\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u3001<br \/>\n-b\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5b58\u5728\u3092\u305d\u3063\u3068\u5fc3\u306b\u3068\u3069\u3081\u3066\u304a\u304f\u3068\u3088\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u5bfa\u5ca1\u3067\u3059\u3002<\/p>\n<p>Rails4.2\u306f\u6765\u5e74\u306e\u590f\u306b\u4e88\u5b9a\u3055\u308c\u3066\u3044\u308bRails5.0\u306b\u5411\u3051\u3066\u30014.x\u7cfb\u6700\u5f8c\u306e\u30de\u30a4\u30ca\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306b\u306a\u308b\u305d\u3046\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306fRails4.2beta1\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3068\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u306f\u307e\u308a\u30dd\u30a4\u30f3\u30c8\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2014\/09\/12\/rails4-2beta1%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6%e6%9c%80%e5%88%9d%e3%81%ab%e3%81%af%e3%81%be%e3%81%a3%e3%81%9f%e3%81%93%e3%81%a8\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[22,24],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4361"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=4361"}],"version-history":[{"count":16,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4361\/revisions"}],"predecessor-version":[{"id":4380,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4361\/revisions\/4380"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=4361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=4361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=4361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}