Win32ãªç°å¢ã§nokogiriãåããã®ã«æéåã£ãã®ã§ã¡ã¢
ããµãã¼ããã£ãã¼ for MacããWindowsã§ãåããã¦ã¿ããããWindowsãªç°å¢ã«nokogiriãã¤ã³ã¹ãã¼ã«ãããã¨ããããç大ã«ããã£ã¦ãã¾ã£ãã
以ä¸ãã®ã¡ã¢
ç°å¢
- WindowsXP SP3
- ActiveScriptRuby 1.8.7 (patch level: 72)
ãªç°å¢ã§nokogiri(1.3.2)ãåãããè¨é²
nokogiriã®ã¤ã³ã¹ãã¼ã«
gem install nokogiri -r
ã§ã¤ã³ã¹ãã¼ã«ã
ä¸åº¦ãlibxsltãç¡ãã¨è¨ãã㦠cyg-apt 㧠libxslt-devel ãã¤ã³ã¹ãã¼ã«ãããããã¾ãããããçµå±æä½æ¥ã§ã¤ã³ã¹ãã¼ã«ãããã¤ã³ã¹ãã¼ã«ã§ããããã®ãããã®æé ã¯çç¥ãå¥ã¨ã³ããªã¨ãã¦èµ·ããã¤ããã
<追è¨>
Cygwinã§ã¯ãcyg-apt ã§ã®lixml2-develã¨libxslt-develããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¦ããå¿
è¦ããã£ãã
$ cyg-apt install libxml2-devel $ cyg-apt install libxslt-devel
追è¨>
ã¤ã³ã¹ãã¼ã«ãããã®ã¯ãã®ã¨ãã®ææ°ã1.3.2ãã¤ã³ã¹ãã¼ã«ãããã
ã§ãirbã§ç¢ºèªãããã¨ããã以ä¸ã®ãããªã¨ã©ã¼
>require 'rubugems' >require 'nokogiri' Gem::LoadError: Could not find RubyGem racc (>= 0) from C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems.rb:578:in `report_activate_error' from C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems.rb:134:in `activate' from C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems.rb:158:in `activate' from C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems.rb:157:in `each' from C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems.rb:157:in `activate' from C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require' from (irb):3
raccã®gemãã¤ã³ã¹ãã¼ã«ããã¦ããªãã£ã½ãã®ã§raccãã¤ã³ã¹ãã¼ã«ãããã¨ã«ãã
raccã®ã¤ã³ã¹ãã¼ã«
raccã®ã¤ã³ã¹ãã¼ã«ã§ãã¨ã©ã¼çºç
ã©ãã extconf.rbã®ä¸ã§ãã©ãããã©ã¼ã ãå¤æããããã«ä½¿ç¨ãã¦ãã`uname -p`ã¨ããã³ãã³ããWindowsã«ç¡ãã¨ãããã¨ã§ãä¾å¤ãçºçãã¦ããã¿ããã
raccã®gemããã¼ã«ã«ã§ä¿®æ£ï¼ã¤ã³ã¹ãã¼ã«
ã¾ãã以ä¸ã®ã³ãã³ã㧠racc ã®gemãåå¾ãã
gem fetch racc -r
次ã«ãåå¾ããgemãå±é
gem unpack racc
ã«ã¬ã³ãã«racc-1.4.6ã¨ãããã£ã¬ã¯ããªãä½æããããã®ä¸ã«raccã®ã½ã¼ã¹ãå±éãããã
次ã«ãracc-1.4.6 ã®ãã£ã¬ã¯ããªã«éãã¦ã以ä¸ã®ã³ãã³ã㧠gemspec ãåå¾ããã
gem spec racc -r > racc.gemspec
gemspecã¯extconf.rbãä¿®æ£ããã®ã¡ãgemãå度çæããããã«å¿ è¦ã
extconf.rbã®ä¿®æ£
ext/racc/cparse/extconf.rb ãã¨ãã£ã¿ã§éã以ä¸ã®ããã«ä¿®æ£
# $Id$ #ENV["ARCHFLAGS"] = "-arch #{`uname -p` =~ /powerpc/ ? 'ppc' : 'i386'}" ENV["ARCHFLAGS"] = "-arch i386}" require 'mkmf' create_makefile 'racc/cparse/cparse'
ã¨ãããããèªåã¯'i386'ãªç°å¢ã«ã¤ã³ã¹ãã¼ã«ããã¨ããã£ã¦ããã®ã§ãä¸è¨ã®ããã«ä¿®æ£ããã
ã»ãã¨ã¯ãä¾å¤ã¨ãã²ãã£ã¦é©åãªãã©ãããã©ã¼ã ãé¸æãã¦ãããé¢æ°ã«ãã¦ãããã»ãããããã ãããªã¼ãã¿ããªã©ããã£ã¦ããã ãï¼
èªå®¶ä¿®æ£çgemã®ä½æ
extconf.rbãä¿®æ£ãããããããå ã«ä¿®æ£çã®gemãã¡ã¤ã«ãçæããã
gem build racc.gemspec
ããã¨ãracc-1.4.6.gem ãçæãããã
ãã¼ã«ã«ã®gemããã¤ã³ã¹ãã¼ã«
gem install racc -l
ã§ãã¼ã«ã«ã®gemãã¡ã¤ã«ããã¤ã³ã¹ãã¼ã«ãããã
ãã®ãnokogiriãä¾åããgemã®ã¤ã³ã¹ãã¼ã«
raccãã¤ã³ã¹ãã¼ã«ã§ããã°ãªKã¨æã£ã¦ããã©ããä»ã«ã足ããªãgemããããããã以ä¸ã®ã³ãã³ãã§ä¾åããgemã調ã¹ãã
gem dependency nokogiri Gem nokogiri-1.3.2-x86-mswin32 racc (>= 0, development) rexical (>= 0, development) rake-compiler (>= 0, development) hoe (>= 2.2.0, development)
ã»ãã¨ã¯ãã®ãã¨ãhoeã®ã¤ã³ã¹ãã¼ã«ã§ã¾ãåé¡ããã£ããã ãã©ã
...ã¡ã¢ãéä¸ã§åãã¦ãã¾ã£ããorz ãã¨ã§è¿½è¨ããã