【问题标题】:Rails Installing libxml2 on WindowsRails 在 Windows 上安装 libxml2
【发布时间】:2011-07-26 17:57:11
【问题描述】:

当我运行bundle install 时,我收到以下错误:

Using activeresource (3.0.3)
Installing libxml-ruby (1.1.4) with native extensions C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension. (
Gem::Installer::ExtensionBuildError)

    C:/RailsInstaller/Ruby1.8.7/bin/ruby.exe extconf.rb
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... yes
checking for inflate() in -lz... no
checking for inflate() in -lzlib... no
checking for inflate() in -lzlib1... yes
checking for iconv_open() in -liconv... no
checking for libiconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for libxml/xmlversion.h... no
checking for libxml/xmlversion.h in /opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... no  extconf failure: need libxml2.

Install the library or try one of the following options to extconf.rb:

  --with-xml2-config=/path/to/xml2-config
  --with-xml2-dir=/path/to/libxml2
  --with-xml2-lib=/path/to/libxml2/lib
  --with-xml2-include=/path/to/libxml2/include

我明白缺少什么,但我不明白如何解决这个问题。提前致谢。

【问题讨论】:

    标签: ruby-on-rails ruby bundler libxml2


    【解决方案1】:

    我在 Windows 上遇到了类似的问题,以下命令有效。

    gem install libxml-ruby -- --with-xml2-include=C:\ruby-1.9.2\include\libxml2
    

    但是,请注意,要使其正常工作,您应该已经在指定的路径中拥有 libxml2 程序集,并且不要使用带有空格或引号的路径。

    【讨论】:

      【解决方案2】:

      我也尝试在 Windows 上运行 Rails,记得遇到过这个问题,但不记得我做了什么,但通过 Google 快速搜索找到了这个链接:http://gnuwin32.sourceforge.net/packages/libxml2.htm

      告诉你如何下载适用于 Windows 的 libxml2。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-08-10
        • 1970-01-01
        • 1970-01-01
        • 2016-08-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多