赞
踩
最近调研使用openstreetmap生态体系,在本地安装openstreetmap-website遇到执行安装命令失败的问题:安装步骤按照官网https://github.com/openstreetmap/openstreetmap-website/blob/master/INSTALL.md 进行的(本地mac环境安装),在执行命令
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
原因是libxml-ruby插件加载不到,需要确保本地已经安装了libxml2插件,然后执行命令安装libxml-ruby成功(ps:/usr/local/Cellar/libxml2/2.9.9_2 根据实际libxml2安装目录配置):
gem install libxml-ruby -v '3.1.0' -- --use-system-libraries --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.9_2/include/libxml2/libxml/ --with-xml2-config=/usr/bin/xml2-config
然后重新执行命令bundle install 继续安装
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。