MacOSXéå®ã»Rails3ã§ã®éçºã§ä½¿ããè¶ æéç¡ããµã¼ããPowã
MacOSXã§Railsã®éçºããã¦ããæ¹ã«ã¡ãã£ã¨æå ±ãæ®éRailsã§éçºããã¦ããã¨ããèªåç¨ã®éçºãµã¼ãããã¼ã«ã«ã§
$ rails s
ã¨ã³ãã³ããæã¡ã使ã£ã¦ãããã¨æãã¾ãã
ãããããã¨ï¼ï¼ï¼ï¼çªã®ãã¼ãã§éçºä¸ã®ã¢ããªãdevelopmentã¢ã¼ãã§ç«ã¡ä¸ãããããã«ãã©ã¦ã¶ã§ã¢ã¯ã»ã¹ãã¦é²è¦§ãçµæãè¸ã¾ãã¦ä¿®æ£ã»ã»ã»ã¨ããæµãã§ãã
ãããã¦ããã¨ä½ãå°ããã¨ããã¨
- ãµã¼ããèªåã§ãã¡ãã¡ç«ä¸ããªãã¨ãããªã
- å¥ã®ã¢ããªãéçºãµã¼ããä¸ããã¨ãªãã¨ããã¼ããããããªãã¨ãããªã
- éçºç¨Webãµã¼ããWebrickã¯å²ãã¨éãã®ã§ä¸ãã£ã±ãªãã«ãã¦ãããªã
- ãã¨ãã£ã¦ApacheãNginxã使ãã¨ãªãã¨ãè¨å®ãã¡ã¤ã«ããã¡ãã¡ä¿®æ£ããããå¿ è¦
ã¨ãã¨ããæãã§ããï¼ã¾ããããã»ã©è¾ãæ©ã¿ã§ããªãã®ã§ããã©ï¼
ã¨ãããã¨ã§ã37Signalsã®æ°ããã¸ã§ã¯ããPowãããç´¹ä»ã
Pow: Zero-configuration Rack server for Mac OS X
ããã¤ã®å£²ãã¯
Pow is a zero-config Rack server for Mac OS X. Have it serving your apps locally in under a minute.
ã¤ã¾ããè¨å®ã¯ä¸è¦ã§ï¼å以å ã«ãµã¼ãããã¼ã«ã«ã«ç«ã¦ã¦ããã¾ãããã¨ã
å®éãä¸è¨ã®URLã§å
¬éããã¦ããScreencast(åç»)ãè¦ãã¨ããã大å¤ã¹ã«ãã¨ç«ã¡ä¸ãã£ã¦ã¾ããã
ãããããã¯è¯ããããå°ãªãã¨ããä»ããæªããªããã®ã§ã¯ãªããã¨ãï½
ã¡ãã£ã¨é¢ç½ãã®ããããã使ãã¨
http://ããã¸ã§ã¯ãã®åå.dev/
ã§ä½æãã¦ããRailsã¢ããªã«ã¢ã¯ã»ã¹åºæ¥ãããã«ãªãããã§ãã©ããã£ã¦ããã®ã ãããããã
ã§ã¯ãã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ãããã
ã¤ã³ã¹ãã¼ã«ä½æ¥
ã¤ã³ã¹ãã¼ã«ã¯
$ curl get.pow.cx | sh
ã§å®äºããªãã¨ç°¡åãªï¼
Rails3ã®é©å½ãªã¢ããªãä½ã£ã¦
$ cd ~/.pow $ ln -s /path/to/myapp
ã§è¨å®å®äºã§ãã
ãªããRVMã使ã£ã¦ããå ´åã¯ã/path/to/myappãã®ä½ç½®ã«.rvmrcã¨ãããã¡ã¤ã«ãä½ã
rvm 1.9.2
ãªã©ã¨ä¸ã«æ¸ãã¦ããã¾ããããã§ãå®è¡æã«ä½¿ãããRubyãæå®ã§ãã¾ãã
ãªãã¨ãããã§ããã¾ãã§ããèªåã§ãµã¼ããç«ã¡ä¸ãã£ã¦ããã¾ãã
ãã©ã¦ã¶ã§ã
http://ããã¸ã§ã¯ãã®åå.dev/
ã«ã¢ã¯ã»ã¹ãã¦ã¿ã¾ãããã
å°å ¥æã®ãã¤ã³ã
- ç°å¢å¤æ°ã¯developmentã§ããã½ã¼ã¹ãæ¸ãæãããèªåã§èªã¿è¾¼ã¿ç´ããèµ·ãã¾ãã
- å¼·å¶çã«ãµã¼ãã®åèµ·åããããå ´åã¯ãPassengerã¨åããã$ touch tmp/restart.txtã
- åä½ãã°ã¯Webrick使ç¨æã¨åãããlog/development.logã«æ¸ããã¾ã
- Powèªä½ã®ã¢ã¯ã»ã¹ãã°ã¯ã~/Library/Logs/Powé ä¸ã«åºåããã¾ã
- å ¬å¼ãã¼ã¸ã§ã¯ãã¤ã³ã¹ãã¼ã«ç´å¾ããåãã¦ããã¨æ¸ããã¦ãã¾ããããç§ã¯.rvmrcãä½ã£ã¦ããªãã¦ã¯ã¾ã£ã¦ã¾ããã
- Powèªä½ã®èµ·åã«ã¤ãã¦ã¯ãã¤ã³ã¹ãã¼ã«æã«Macã®èµ·åã¨å ±ã«ç«ã¡ä¸ããããè¨å®ããã¾ã
- ãªãã ãPowã®èª¿åãæªãã®ã§ã¯ï¼ã¨ããã¨ãã¯ãpsã§node.jsã®pidãè¦ã¤ãã¦killãã¦ä¸ãããããã»ã¹ãæ¶ããã¨ãæ°ããããã»ã¹ãèªåçã«ä¸ãã£ã¦ãã¾ã
Powã¯ã©ããã£ã¦ãã®ï¼
å ¬å¼ããã¥ã¡ã³ãã¨å®éã«ã¤ã³ã¹ãã¼ã«ããããã¡ã¤ã«ãªã©ãè¦ãã¨ãããPowã¯ä»¥ä¸ã®æµãã§åãã¦ããããã§ãã
- /etc/resolverã®ä¸ã«devã¨ãããã¡ã¤ã«ãä½ãããããã§åãåããã®ãã¡ã¤ã³åããdevãã®å ´åã®ã¿ã/etc/resolver/devã®è¨å®ãåç §ããã
- ã.devã¨ãããã¡ã¤ã³ã¸ã®ãªã¯ã¨ã¹ãã®å ´åã¯ããã¼ã«ã«ã®ãã¼ã20560ã«éãããæ¸ããã¦ãã
- 20560ã§ã¯dnsã®æ©è½ã¨nackã¨ããnode.jsã§æ¸ãããRackã®ãµã¼ããåãã¦ãã
- ãªã¯ã¨ã¹ããããã¨nack*1ãProxyã®å½¹ç®ãè¡ããé ä¸ã§åãRackãµã¼ãã¤ã¾ãèªåãè¨å®ãããã¹ã®ãµã¼ãã¸ã¢ã¯ã»ã¹ãè¡ããã
ã¨ããæãã§ããã
Passengerã®åããnode.jsã使ã£ã¦ä»£ç¨ãã¦ããæãã®ã¨ããã¨ã/etc/resolverã®ä¸ã«ãã¡ã¤ã³åã®ãã¡ã¤ã«ãç½®ãäºã§ãç¹å®ã®ãã¡ã¤ã³æ¯ã«DNSãªã©ãåãæ¿ãããã¨ãã§ãã*2ã¨ãããMacOSXã®ç¹æ§ãçãããé¢ç½ããã¼ã«ã«ãµã¼ãã§ãã
ã¨ãããã¨ã§ãæ¬çªãµã¼ãã«è¿ãæ§æã§ããã¤æéç¡ãéçºç¨ãµã¼ããç«ã¡ä¸ããPowããã
使ã£ã¦ã¿ã¦ä¸ããã