hpricot を入れようとしてトラブった @ Ruby on Windows.

RubyGems で hpricot を入れようとしてトラブったのでメモ。

トラブル内容は以下の通り。
stdio.h 、つまりコンパイル環境が要求される。

C:\ruby>gem install hpricot
Building native extensions.  This could take a while...
ERROR:  Error installing hpricot:
        ERROR: Failed to build gem native extension.

C:/ruby/bin/ruby.exe extconf.rb install hpricot
checking for stdio.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/ruby/bin/ruby


Gem files will remain installed in C:/ruby/lib/ruby/gems/1.8/gems
/hpricot-0.6.161 for inspection.
Results logged to C:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.161/
ext/fast_xs/gem_make.out

ググったところ、

gem install hpricot --source http://code.whytheluckystiff.net

とすればよろしいようで。(http://blog.livedoor.jp/sasata299/archives/51103145.html)

C:\ruby>gem install hpricot --source http://code.whytheluckystiff.net
Successfully installed hpricot-0.6-x86-mswin32
1 gem installed
Installing ri documentation for hpricot-0.6-x86-mswin32...
Installing RDoc documentation for hpricot-0.6-x86-mswin32...

C:\ruby>gem list --local

*** LOCAL GEMS ***

hpricot (0.6)

C:\ruby>

と無事にセットアップできました。