2006-01-01ãã1å¹´éã®è¨äºä¸è¦§
第ä¸åå http://journal.mycom.co.jp/articles/2006/12/22/wirble/ irb(1)ã«ã¯æ¡å¼µã»ããã¨ãã¦Wirbleã¨ããããã±ã¼ã¸ãç¨æããã¦ããã®ã ããåããã±ã¼ã¸ã使ãã¨ã¤ã³ã¿ã©ã¯ãã£ãã·ã§ã«ã«è²ãã¤ãããã«ãªãã»ããè£å®å ¥åãå¹ãããã«ãªããªã©ä¾¿å©ã â¦
第äºåä¹åãã¡ããï¼åæ¥ããããï¼ä»¥ä¸ï¼ ã¨è¨ã£ã¦ãã¾ãã¨ããªãä¹±æ´ãªã®ã§ï¼ç¾å®ã«ä»å¤§å¦é¢çããã£ã¦ããèªåãªãã«ãã®çç±ã«ã¤ãã¦èãã¦ã¿ãï¼ å ã«ç°¡åã«ã¾ã¨ãã¦ããã¨ä»¥ä¸ã®2ç¹ã®ãããªæ°ãããï¼ äººã«ç©äºãããããããä¼ãã ç®ã«è¦ããææãâ¦
第äºåå «åã¯ã¦ãªãã¤ã¢ãªã¼ã®ãã«ããè¦ã¦ããã¨çºè¦ããï¼ ã¹ã¼ãã¼preè¨æ³ã®å¿ç¨ã§å¯è½ã«ãªãããã ï¼ã¨ãããããã¹ããã¦ã¿ãï¼ class Foo def bar'baz' # return baz end end ä»ã¾ã§ã¯ãã ã®ã¹ã¼ãã¼preã§è¡¨ç¤ºããã¦ããã®ã§ï¼è¦ããããªã£ãããããªâ¦
ãã¡ã¤ã«ããã¦ã³ãã¼ãããã«ã¯curlã¨ããã³ãã³ãã使ãï¼ å®ã¯ãã¡ã¤ã«ãã¦ã³ãã¼ãã ãã§ã¯ãªãï¼ã¢ãããã¼ãã¨ããã§ãããããï¼ å©ç¨ä¾ï¼ã³ãã³ãã©ã¤ã³ï¼ curl -L -O http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz % Total % Reâ¦
第äºåä¸åå çã«ä½¿ã£ã¦ãããã¨è¨ãããã®ã§ï¼å¼µãåã£ã¦ä½¿ããã¨ã«ãããï¼ã¨ããããã§ï¼Windowsã¨Linuxãã触ã£ããã¨ããªãã£ã*1ã®ã§ï¼ããã«Macåå¿é²ãæ®ãï¼ *1:ä¸ç¬ã ãMacBookã使ã£ã¦ããã¨ã¯ãã£ãã
第äºåå å ã¨ããããã§ï¼Railsã§èªå·±åç §å¤å¯¾å¤ã¢ã½ã·ã¨ã¼ã·ã§ã³ãhas_many :throughãå©ç¨ãã¦å®è£ ãã¦ã¿ãã¡ã¢ï¼ ä»åç¨æãããµã³ãã«ã¯Webãã¼ã¸ããªã³ã¯ã§ç¹ãã£ã¦ãã¤ã¡ã¼ã¸ï¼ERDã¯ä»¥ä¸ã®ç»åã¿ãããªæãï¼ ããããã®modelã¯ãããªæãï¼ class Paâ¦
PostgreSQL 8.1.4 èµ·åã¨èªåèµ·åè¨å®ãã¸ããåèã«PostgreSQLãèµ·åããä¸ã§ï¼Ludiaã®READMEã«ãããµã³ãã«ã試ãã¦ã¿ãï¼ su - postgres createdb test psql -f /usr/local/src/ludia-0.8.0/pgsenna2.sql test psql testpsql testã§PostgreSQLã®ã¿ã¼ããâ¦
cd /usr/local/src wget http://keihanna.dl.sourceforge.jp/ludia/22126/ludia-0.8.0.tar.gz tar xvfz ludia-0.8.0.tar.gz cd ludia-0.8.0 chmod a+x install-sh ./configure make sudo make installããã§ã¤ã³ã¹ãã¼ã«å®äºï¼æå¾ã«RailsããPostgreSQLããâ¦
èªåã¯PostgreSQLãåãã¦ä½¿ã£ã¦ã¿ãï¼ææ°çã®8.1.4ãå©ç¨ããã®ã§ã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«ï¼ cd /usr/loval/src wget ftp://ftp.jp.postgresql.org/source/v8.1.4/postgresql-8.1.4.tar.gz tar xvfz postgresql-8.1.4.tar.gz cd postgresql-8.1.4 ./configuâ¦
Sennaã¯ãã»ã³ããã§ã¯ãªããã»ããã¨èªããããï¼ã¨ãã訳ã§ä»¥ä¸ã®æé ã§ã¤ã³ã¹ãã¼ã«ï¼ cd /usr/local/src wget http://keihanna.dl.sourceforge.jp/senna/21716/senna-0.8.1.tar.gz tar xvfz senna-0.8.1.tar.gz cd senna-0.8.1 export CFLAGS='-I/usr/loâ¦
以ä¸ã®æé ã§ã¤ã³ã¹ãã¼ã«ããï¼ å¿ é ã§ã¯ãªããï¼èªåã§MeCabãRubyãã使ãã®ã§åè©IDãå©ç¨ã§ããããã«ãã¦ãããï¼ MeCab-0.96ããã¯åè©IDã®å©ç¨ãããã©ã«ãã§æå¹ã«ãªã£ã¦ããããï¼ä»¥ä¸ã®ãã¡Makefileã®ä¿®æ£ã¯ä¸è¦ã§ãï¼ cd /usr/local/src wget htâ¦
ãã¼ã¿ãã¼ã¹çµã¿è¾¼ã¿åå ¨ææ¤ç´¢ã¨ã³ã¸ã³ãªã®ã§ï¼å½ç¶ãã¼ã¿ãã¼ã¹ã®PostgreSQLãå¿ è¦ã§ããï¼ã¾ãï¼å ¨ææ¤ç´¢æ©è½ã«ã¯Sennaãå©ç¨ãã¦ããã®ã§ããããã¡ããå¿ è¦ï¼ãã¨ï¼Sennaã¯ããã©ã«ãã§N-gramã«ããã¤ã³ããã·ã³ã°ãè¡ãã®ã§ï¼åèªåºåãã«ããã¤ã³ãâ¦
第äºåäºå å¤æ°ã®ææ¸ã®ä¸ãããããã¼ã¯ã¼ããå«ãææ¸ãè¦ã¤ããããã®æ©æ§ãæ¤ç´¢ã¨ããï¼ ãã®ä¸ã§ï¼ãªã¼ãã³ã½ã¼ã¹ã®å ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ã¯HyperEstraierãä»ã¾ã§ä½¿ã£ã¦ãããï¼æè¿åºã¦ããLudiaã試ãã¦ã¿ãã®ã§ï¼ã¤ã³ã¹ãã¼ã«æ¹æ³ã®ã¡ã¢ï¼ ã¡ãªã¿ã«ï¼â¦
第äºååå æ¥æ¬èªWikipediaã®å ¨ææ¸ãæ¯éåã«ãã¦åèªã®IDFãã¼ãã«ãä½ã£ã¦ã¦ï¼ç¸å¤ãããä¸é±éããããããã®ã ãï¼ï¼ã©ããUTF-8ã§ã¨ã¹ã±ã¼ãããURLãMySQLã®varchar(255)ã«å ¥ããã£ã¦ããªããããªã®ã§ï¼migrationãã¦ã¿ãã¨æãããã®ã§ï¼ç´æ¥MySQLâ¦
第äºåä¸å ææ¸ãMeCabã使ã£ã¦å½¢æ ç´ è§£æãã¦ãããï¼åè©ã ããæãåºãããã¨ãï¼åºæåè©ã ããå¿ è¦ã¨ããã¨ãã«ï¼ä»ã¾ã§ã¯åè©æ å ±ããæ£è¦è¡¨ç¾ã§ãããããã¦å ´ååããã¦ããï¼ããããã£ã±ãå¦çã¨ãã¦ã¯é ãããã ï¼ ããã§ï¼åè©æ å ±ããæ£è¦è¡¨ç¾â¦
第äºåäºå ãã¦ï¼ç´ä¸ã¶æã¶ãã«æ´æ°ï¼ VMwareã«ã¤ã³ã¹ãã¼ã«ããFedoraCore4ã§Railsããã¦ããã¶ããã«ï¼Emacsã§ä½¿ããRailsç¨modeãã¤ã³ã¹ãã¼ã«ããï¼ WEBrick/Mongrelã®ç®¡ç Ansiã«ã©ã¼ã使ã£ããã°ãã¡ã¤ã«è¡¨ç¤º Action/Viewéã®ãã°ã«ã¹ã¤ãã TextMatâ¦
第äºåä¸å è«æPDFãHyper Estraierã§æ¤ç´¢ã§ããããã«ããããï¼PDFææ¸ãã¤ã³ããã¯ã¹ã«ç»é²ããå¿ è¦ãããï¼ãããï¼Hyper Estraierä»å±ã®PDFææ¸ç¨ã¹ã¯ãªããã¯HTMLææ¸ã«å¤æããå¾ï¼ã¤ã³ããã¯ã¹ã«è¿½å ããã¨ããåä½ããã¦ããï¼ããã«ï¼ã¿ã¤ãã«ã«Pâ¦
第äºåå å ¨ææ¤ç´¢ã¨ã³ã¸ã³Hyper Estraierãã¤ã³ã¹ãã¼ã«ããããã ãï¼ãããRubyããæä½ã§ããããã«Rubyã¯ã©ã¹ã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ããï¼Rubyã¯ã©ã¹ã©ã¤ãã©ãªã«ã¯äºã¤ããï¼ãRubyNativeAPIãã¯RubyããHyper Estraierã®ãã¼ã¿ãã¼ã¹ãèªãã ãæ¸â¦
第åä¹å ãã¦ï¼å æ¥ã®ç¶ãã§ããï¼ç 究室ã«è«æPDFãé²è¦§ã§ããWebãµã¼ããè¨ç½®ããããã ãï¼ãã®è«æPDFã¯è²ã ãªå¦ä¼ãã¨ã«åãããã¦ããï¼ããã«ï¼ããããã®å¦ä¼ã®Indexãã¼ã¸ãåå¨ãï¼ããããè«æPDFã¸ã®ãªã³ã¯ãå¼µããã¦ããã¨ãã£ãæãã ï¼ããâ¦
第åå «å å æ¥ã®æ¥è¨ã§æ¸ããããã«ï¼å¤§å¦ã®ç 究室ã§ç 究ã®å©ãã¨ãªãããã«ï¼éå»ã«çºè¡¨ãããè«æãä¿åãã¦ãã¤ã§ãé²è¦§ã»æ¤ç´¢ãåºæ¥ãããã«ãããã¨è©¦ã¿ãï¼ ã¨ããããï¼å çãããåãããLink-Stationãè¨ç½®ãï¼Apacheã§éç¨ããWebãµã¼ãã«ãããã¯â¦
第åå å CUIã«ã¯ã¾ã æ £ãã¦ãããï¼Webãã©ããã£ã¦è¦ãã®ãããåãããªãï¼ ããã§ï¼Windowsç°å¢ãããªã¢ã¼ããã°ã¤ã³ãã¦ä½¿ããã¨ã«ããï¼ ä½¿ã£ãã®ã¯PuTTYã§ï¼SSHãå©ç¨ãã¦éä¿¡ãæå·åã§ããã®ã§ï¼ ãã¹ã¯ã¼ãçãå¹³æã§æµãã¦ãã¾ãtelnetã¨ããããâ¦
第åä¸å æ©éï¼ãµã¼ãã¨ã¯å¥ã«ç¨æãããããã¯ã¼ã¯ã¹ãã¬ã¼ã¸ããµã¼ãã« ãã¦ã³ãããããã«Sambaã使ã£ã¦ã¿ãï¼ã¨ããããã¯ï¼smbãããã³ã« ãå©ç¨ããã¨ããæ¹ãæ£ãããï¼ rootã«ãªã£ã¦ä»¥ä¸ã®ã³ãã³ããå ¥åããï¼ # smbmount //[domain or IPadress]/â¦
第åäºå ç 究室ã§ä½¿ã£ã¦ãããµã¼ããåããªããªã£ãï¼ ãããããã¼ããã£ã¹ã¯ãã©ã¤ãããã¡ãªãã ããï¼ èµ·åæã«ä½åº¦ãæ¢ã¾ã£ããï¼ã¡ãã£ã¨æä½ããã«æ¾ã£ã¦ããã¨æ¢ã¾ãï¼ ãªã®ã§ï¼å¥ã®è¨ç®æ©ããµã¼ãã¨ãã¦ä½¿ããã¦ããã ããã¨ã«ï¼ 以åã¯ï¼GUIã§ãµâ¦
第ååå ã¿ã¤ãã«ã®éãã§ããï¼orz Apache2.2.0ãå©ç¨ããã¨Rubyã§ä½ã£ãã¹ã¯ãªãããåããªãï¼ é常ã®HTMLããRubyãCGIã¨ãã¦å¼ã³åºãã¦ããã®ã ãï¼ã½ã¼ã¹ããã®ã¾ã¾è¡¨ç¤ºããã¦ãã¾ãï¼ Rubyã¹ã¯ãªãããç´æ¥é²è¦§ãã¦ãï¼åãããã«ã½ã¼ã¹ã表示ããã¦â¦
第åä¸å ãã¦ãååApacheã®apxsãç¡ãã£ãããã§ã¤ã³ã¹ãã¼ã«ã§ããªãã£ãmod_rubyã ã£ããã Apache2.2.0ãã¤ã³ã¹ãã¼ã«ããéDSOãæå¹ã«ããã®ã§åææ¦ãã¦ã¿ãã
第åäºå ä»æ¥ã¯æ´æ°ãå¤ããªï¼ã¨ãã訳ã§ããã°ãã¯ï¼ Apache2.2.0ã¯ã²ã¨ã¾ãåãããããªã®ã§ï¼æ¬¡ã¯erubyãã¤ã³ã¹ãã¼ã«ãããï¼ ãã®erubyã¨ã¯ï¼ã¹ã¯ãªããè¨èªã§ããRubyã®ã³ã¼ããããã¹ããã¡ã¤ã«ï¼ä¾ãã°HTMLãã¼ã¸ãªã©ï¼ã«åãè¾¼ãããã®è¨èªã§ããâ¦
第åä¸å å æ¥ã¤ã³ã¹ãã¼ã«ããApache2.2.0ã®è¨å®ããã¦ã¿ãï¼ã¤ã³ã¹ãã¼ã«ããããã£ã¬ã¯ããªã¯ããã©ã«ãã®/usr/local/apache2ã§ï¼ãã®è¨å®ãã¡ã¤ã«ã¯/usr/local/apache2/conf/httpd.confã§ããï¼ å¤æ´ããã®ã¯ä»¥ä¸ã®é¨åï¼ user apache group apache Servâ¦
第åå Rubyã¯ã¾ã¤ãã¨ããã²ãæ°ãä½ã£ãã¹ã¯ãªããè¨èªã§ããï¼ ãã®ãªãã¡ã¬ã³ã¹ã¯æ§ã ãããï¼ä»åã¯ã³ãã³ãã©ã¤ã³ãã使ããReFeãã¤ã³ã¹ãã¼ã«ããï¼ ã¤ã³ã¹ãã¼ã«æ¹æ³ã¯ä»¥ä¸ã®éãï¼gemsãããã°é常ã«ç°¡åã ï¼ $ gem install refe ãã®ReFeï¼èªã¿æ¹â¦
第ä¹å 2005å¹´12æã«HTTPãµã¼ãã®Apache 2.2.0ããªãªã¼ã¹ãããï¼ èªåã¯ï¼FedoraCore4ã«ã¯ããããå ¥ã£ã¦ããApache 2.0.54ã使ã£ã¦ãããï¼ å æ¥mod_rubyãã¤ã³ã¹ãã¼ã«ãããã¨ãã¦å¤±æããããã«ï¼ DSOãæå¹ã«ãªã£ã¦ããªãã£ãã®ã§ï¼ãããæ©ã«å ¥ãæ¿ãâ¦
第ä¸å Ruby on Railsã¯ãã¼ã¿ãã¼ã¹ã¨å¯æ¥ã«é¢ä¿ãã¦ããï¼ ä»åã¯ï¼RDBMã¨ãã¦MySQLãå©ç¨ãããã¨ã«ããï¼ ããã§ï¼Rubyã¨MySQLãç¹ããã©ã¤ãã©ãªã¨ãã¦MySQL/Rubyã使ã£ã¦ã¿ãï¼ ã¾ãï¼We retire raa.ruby-lang.orgãããã¦ã³ãã¼ãï¼ # ãããæ¸ãã¦ãâ¦