gpt4 book ai didi

ruby-on-rails - Rails 在 Windows 上安装 libxml2

转载 作者:太空宇宙 更新时间:2023-11-03 18:29:05 24 4
gpt4 key购买 nike

当我运行 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

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

最佳答案

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

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

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

关于ruby-on-rails - Rails 在 Windows 上安装 libxml2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6834366/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com