捆绑安装无法安装libxml-ruby [英] Bundle install fails to install libxml-ruby

查看:64
本文介绍了捆绑安装无法安装libxml-ruby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ruby世界的新手,我需要克隆一个现有项目。

I'm a new to Ruby world and I need to clone an existing project.

说明如下:

source .env.development
bundle install

但是它失败了:

Using libv8 3.16.14.15
Fetching libxml-ruby 2.9.0
Installing libxml-ruby 2.9.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/vlad/.rvm/gems/ruby-2.3.1/gems/libxml-ruby-2.9.0/ext/libxml
/Users/vlad/.rvm/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20181109-46682-fvgifh.rb extconf.rb --use-system-libraries
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... 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
--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=/Users/vlad/.rvm/rubies/ruby-2.3.1/bin/$(RUBY_BASE_NAME)
--with-xml2-config
--without-xml2-config
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
 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


To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/vlad/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-18/2.3.0/libxml-ruby-2.9.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/vlad/.rvm/gems/ruby-2.3.1/gems/libxml-ruby-2.9.0 for inspection.
Results logged to /Users/vlad/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-18/2.3.0/libxml-ruby-2.9.0/gem_make.out

An error occurred while installing libxml-ruby (2.9.0), and Bundler cannot continue.
Make sure that `gem install libxml-ruby -v '2.9.0'` succeeds before bundling.

In Gemfile:
  upnxt_community_lib_common was resolved to 1.7.49, which depends on
    upnxt_processing_lib_document was resolved to 2.0.0, which depends on
      libxml-

如果我想执行建议的命令 gem install libxml-ruby -v'2.9.0'我犯了同样的错误。

If I want to execute the command that is suggested "gem install libxml-ruby -v '2.9.0'" I get the same error.

操作系统:MacOS Mojave,版本10.14。
项目需要的Ruby版本:ruby 2.3.1p112(2016-04-26修订版54768)[x86_64-darwin18]

Operating System: MacOS Mojave, version 10.14. Ruby version needed for the project: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin18]

我也尝试过但没有帮助。

I also tried this but it didn't helped.

在此先感谢您的帮助!

推荐答案

如果有人遇到此问题,我会在同事的帮助下解决此问题:

I manage to fix this with the help of a colleague, if anybody else encounter this problem:

gem install libxml-ruby -v '2.9.0' -- --use-system-libraries --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.8/include/libxml2/libxml/ --with-xml2-config=/usr/bin/xml2-config

用所需的libxml版本替换 2.9.0!

Replace '2.9.0' with the libxml version that you need!

这篇关于捆绑安装无法安装libxml-ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆