これに似た質問に関するスレッドがいくつかありますが、どれも効果的であることが証明されていません. 私も運がないので、githubページで質問しようとしました。
標準コマンドを試すと:
gem install libxml-ruby
インストーラーが libxml2.dll を見つけられないというエラーが表示されます。同様の問題を抱えたスタックオーバーフロー スレッドを見つけ、欠落しているライブラリを取得する場所とそれらを含める場所に関するユーザーのガイドラインに従いました。
以下を使用して、インストール コマンドに引数を追加して、不足しているライブラリを含むディレクトリを指す場合:
gem install libxml-ruby -- with-xml2-include=C:\Ruby200\include\libxml2 --with-iconv-include=C:\Ruby200\include
C:\Ruby200\include ディレクトリにある「iconv.h」ヘッダーをインストーラーが見つけられないというエラーが表示されます。
C:\Users\gonz102>gem install libxml-ruby -- with-xml2-include=C:/Ruby200/include
/libxml2 --with-iconv-include=C:/Ruby200/include
Temporarily enhancing PATH to include DevKit...
Building native extensions with: 'with-xml2-include=C:/Ruby200/include/libxml2 -
-with-iconv-include=C:/Ruby200/include'
This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb with-xml2-include=C:/Ruby200/include/libx
ml2 --with-iconv-include=C:/Ruby200/include
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libx
ml2,/usr/local/include/libxml2,/usr/include/libxml2... yes
checking for xmlParseDoc() in -lxml2... yes
checking for rb_io_bufwrite() in ruby/io.h... yes
creating extconf.h
creating Makefile
make "DESTDIR="
compiling libxml.c
In file included from C:/Ruby200/include/libxml2/libxml/parser.h:810:0,
from ruby_libxml.h:7,
from libxml.c:1:
C:/Ruby200/include/libxml2/libxml/encoding.h:28:19: fatal error: iconv.h: No suc
h file or directory
compilation terminated.
make: *** [libxml.o] Error 1
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/libxml-ru
by-2.9.0 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/libxml-ruby-2.9.0/ext/libx
ml/gem_make.out
次に何を調査するか、または可能な解決策について何か提案があれば、私は大いに感謝します。私は長い間これに悩まされてきましたが、libxml を使用するプロジェクトに出くわすたびに戻ってきて、喜んでアドバイスを受け取ります。
どうもありがとう。