Virtual Boxä¸ã§Rails 4.2.1㧠WEBRickãç«ã¡ä¸ãããæ¥ç¶ã§ããªãã£ã話
æè¿ããããã¤ã³ã¹ãã¼ã«ã§Railsã®åå¼·ãã¦ããã®ã§ãããã¬ãã¹ã³éãã«ãã£ã¦ãåããªãã¦å°ã£ã話ã
"ã¯ããã¦ã®Ruby on Rails #3" ã§ãã©ã¦ã¶ããåä½ç¢ºèªããã¨æ¥ç¶ã§ããªãã£ãã®ã§ãªãããªï¼ã¨èª¿ã¹ãçµç·¯ã®è¨é²ã *1
調æ»æ¹æ³
- ã¾ãVirtual Boxä¸ã®Guest OSã¨ã®çéãHostå´ããã§ãã¦ãªãï¼ã¨æãã¾ããã
- WEBRickãæ£å¸¸ã«åãã¦ãªãï¼ã¨æãã¾ããã
- ããã§ãWEBRickèµ·åæã«è¡¨ç¤ºãããPort:3000ãListenãã¦ããªãã®ã§ã¯ï¼ã¨æãç«ã¤ã
ããã¾ã§ã®èª¿æ»çµæããRailsããWEBRickãç«ã¡ä¸ããéã«127.0.0.1ã«bindãã¦ããããHostããç¹ãããªãã®ã ãªãã¨ããããæ¨æ¸¬ã
ããã§ãrails sãã®ãªãã·ã§ã³ãããã¹ã¦rails s --bind=0.0.0.0ã§ç«ã¡ä¸ããã¨ããHostå´ãããã©ã¦ã¶çµç±ã§ç¹ãããã¨ã確èªã§ãã¾ããã *2
ãã§ãããã§ããã
ã¨ãè¡ãããã¨ããã§ããå°ãæ°ã«ãªãã¨ãããããã
- 127.0.0.1ã¨0.0.0.0ã£ã¦ã©ãéãããããã ã£ãï¼
ã¨ããããã§æ¬¡ã¯ããã®èª¿æ»ã
ã¨ããã£ã¦ããã¨å
¨ç¶Railsåãããªããã©ããããã足åãã¨ãããåºç¤çãªãã¨ãåºãã¦ãããªãã¨ãã¨ãã¨ç解ããã«æ³¥æ²¼ã«çªã£è¾¼ãã®ã§å¤§äºãªã¹ãããã ã¨æãã®ã§ãã
æéãå°ã¶ãããªçµç¹ã§ã¯åºæ¥ãªããã©ãèªåã®è¶£å³ã§ãã£ã¦ããã®ã§è¯ãããã