普通にgemでインストールするとずらずらとエラーが出る。
> 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 checking for stdio.h... *** 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 --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby/bin/ruby C:/Ruby/lib/ruby/1.9.1/mkmf.rb:364:in `try_do': The complier failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:433:in `try_cpp' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:811:in `block in have_header' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:670:in `block in checking_for' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:276:in `block (2 levels) in postpone' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:250:in `open' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:276:in `block in postpone' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:250:in `open' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:272:in `postpone' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:669:in `checking_for' from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:810:in `have_header' from extconf.rb:2:in `' Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.9.1/gems/hpricot-0.8.2 for inspection. Results logged to C:/Ruby/lib/ruby/gems/1.9.1/gems/hpricot-0.8.2/ext/fast_xs/gem_make.out
検索すると、why the lucky stiff のサイトからソースをダウンロードする方法が見つかったが、これもダメ。
> gem install hpricot --source http://code.whytheluckystiff.net ERROR: http://code.whytheluckystiff.net/ does not appear to be a repository ERROR: Could not find a valid gem 'hpricot' (>= 0) in any repository
結局プラットフォームを指定してやることでインストールに成功した。
> gem install hpricot --platform=mswin32 Successfully installed hpricot-0.8.2-x86-mswin32 1 gem installed Installing ri documentation for hpricot-0.8.2-x86-mswin32... Updating class cache with 0 classes... Installing RDoc documentation for hpricot-0.8.2-x86-mswin32...